Lexical or Preprocessor issue ‘xxx.h’ file not found
NSMutableArray に要素をランダムに並び替える機能を入れようと思い、
objective c – What's the Best Way to Shuffle an NSMutableArray? – Stack Overflow
を見て、NSMutableArray にカテゴリを追加するために .h .m を追加したところ、ビルド時に
Lexical or Preprocessor issue ‘xxx.h’ file not found
が発生。いろいろ試したが解決できない。
いつものようにこのエラー文言で検索したところ下記を発見。
Lexical or Preprocessor issue 'Xxx.h' file not found – 悪あがきプログラマー
Xcode4再起動でビルドできるようになった。
たまにXcode再起動で直る問題がありますな…
本題と関係ないけれども、追加したカテゴリはこちら。
// NSMutableArray_Shuffling.h #if TARGET_OS_IPHONE #import <UIKit/UIKit.h> #else #include <Cocoa/Cocoa.h> #endif // This category enhances NSMutableArray by providing // methods to randomly shuffle the elements. @interface NSMutableArray (Shuffling) - (void)shuffle; @end
#import “NSMutableArray_Shuffling.h”
@implementation NSMutableArray (Shuffling)
– (void)shuffle
{
NSUInteger count = [self count];
for (NSUInteger i = 0; i < count; ++i) {
// Select a random element between i and end of array to swap with.
int nElements = count - i;
int n = (arc4random() % nElements) + i;
[self exchangeObjectAtIndex:i withObjectAtIndex:n];
}
}
@end
[/c]
関連記事
-
-
LogLocations 1.3.4 リリース
久しぶりに、LogLocations をアップデートしました。今までピンを置いていた画面に、時刻を表
-
-
メイドインジャパンとiPad、どこが違う? 世界で勝てるデジタル家電 感想
西田宗千佳氏の本はいつも面白い。 今回も予想に違わず面白かった。 自分も同じような情報は知っているは
-
-
GoodNotes5使いこなし
iPad Pro 12.9インチを購入した 理由の一つである、Apple Pencil
-
-
ドラムちゃんに電子ドラムiWordを接続する
ドラム譜学習アプリ「ドラムちゃん」に、安価なMIDI電子ドラム iWord を接続する方法を説明し
-
-
Apple Special Event 2019
https://japanese.engadget.com/2019/09/10/5-iphone
-
-
LogLocations iOS7 不具合調査 (startMonitoringSignificantLocationChanges 挙動変更)
LogLocations のユーザの方から、iOS7 になってからLogLocationsでログが保
-
-
[iOS SDK] EverLearn 3Dタッチ対応
iPhone 7 Plus を購入したので、まずは EverLearn から、3Dタッチの対応を行い
-
-
[iOS SDK] Pebble腕時計対応iOSアプリを作る
英単語学習アプリ WordLearnをリリースしましたに書いたけれども今Pebble腕時計対応iOS
-
-
Apple Special Event 2011
2011年は iPhone 4s が発表された。 https://japanese.enga
-
-
Apple Special Event 2014
https://japanese.engadget.com/2014/09/09/9-9/