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]
関連記事
-
-
KORG LP-380 で QUICCO SOUND mi.1 を使ってみた
電子ピアノ KORG LP-380 を買ったのでこの機会に以前から気になっていた QUICCO SO
-
-
iPad mini 用透明ハードケース eggshell for iPad mini
iPad mini 用にハードケースを購入した。 iPad 用ケー
-
-
iPhone SDKでユーザデータをローカルに保存したい
一応5日より次のiPhoneアプリの開発を始めた。 前回のアプリはアプリの設定をちょこっとローカルに
-
-
FlashAir W-03活用開始
ようやく休みになったので、FlashAir W-03を活用してみることにした。まずは、iOSから使え
-
-
simplism 0.7mm Ultra Thin Case for iPhone 6 Plus(5.5inch)購入
Amazonを見ているとiPhone 6 Plus の筐体はそれなりに傷が付きや
-
-
Apple Special Event 2010
2010年は、1月に初代 iPad が発表され、6月にWWDCでiPhone4が発表されるという、
-
-
詳解 Objective-C 2.0 改訂版 2010年12月17日発売
まだ書店で遭遇できてないけれども荻原さんの詳解 Objective-C 2.0の改訂版が発売されてい
-
-
EverLearn 1.9.0 に音声認識機能を追加しました
EverLearn 1.9.0 にて音声認識機能を追加しました。ホーム画面から、マイクボタンを押して
-
-
LSSupportsOpeningDocumentsInPlace
拙作英単語学習アプリ EverLearn で LSSupportsOpeningDocuments
-
-
謎のエラー iPhone/iPod Touch: application executable is missing a required architecture
リズムくん Ver.1.1の App Store への Submit の際に、謎のエラー iPhon