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]
関連記事
-
-
Flurryでアプリ利用状況解析
ブログには書く機会がなかったが、昔からアプリで Flurry をアプリに組み込んで、利用状
-
-
[iOS SDK] iOS5 の Twitter 機能を利用してみる
iOS5でシンプルツイッター機能をあなたのアプリにも。 | mipoiApp-iPhoneアプリ
-
-
iOS デバイスサポート最終バージョン
iOS9からGKSession over Bluetoothが無効に なってしまったので Multi
-
-
初 iPadアプリ おんぷちゃん for iPad 公開
iPadグランドオープニングに間に合わせるためしばらく格闘していたがようやく おんぷちゃん for
-
-
Everio で撮影した動画を写真袋で公開する
年末に奥さんが Victor Everio GZ-HM670 で撮影した長女のバレエ動画を写真袋で
-
-
dyld`__abort_with_payload:でクラッシュ WatchKitApp on Xcode11.1
Xcode 11.0 や Xcode11.1で以前はビルドして実行できていたWatchKi
-
-
iPhoneアプリ おんぷちゃん開発日記 音楽理論学習本 Practical Theory Complete
おんぷちゃん開発のために多少の音楽理論が必要となり、良い本を探していたところ下記の本を発見しました。
-
-
iPhone 6 Plus iSight カメラ交換プログラムに行ってきた
iPhone 6 Plus iSight カメラ交換プログラム - Apple サポート の発表があ
-
-
[Xcode] iOS Developer Program 証明書の更新 2018
恒例の、年に一度の証明書の更新。今年はこのページを参照した。年に一度しか行わない作業だが、さすがに迷
-
-
EverLearn 1.8.1 を公開しました
EverLearn 1.8.1 を本日公開しました (2016/10/27)単語検索ページで単語をハ