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]
関連記事
-
App Storeの売り上げを簡単に確認できるMacアプリAppViz
App Storeでのアプリの毎日の売り上げを確認したい場合、これまでは AppSalesを使ってい
-
確かに薄い iPhoneケース eggshell iPhone クリア
試しにiPhoneアプリのwordpressで更新してみる。 とにかく薄いiPhoneケースがほしく
-
MacPeople 2010.02
定期購読している MacPeople 2010年2月号が今日届いた。 今回はメールアプリとUbunt
-
Topeak Ridecase for iPhone 7 Plus は2017年1月発売
(画像はiPhone 6 Plus 用 Ridecase)7月にTopeak Ridecase fo
-
ようやくAppStore に Submit
@ITの 日本人がつまずかないためのiPhone開発ポイント を読みながらAppStoreにアプリ公
-
初代 iPad mini 16GB ブラックスレート注文
予約は10/26(金)16:00 きっかりに開始され、iPad mini 16GB ブラックスレート
-
[iOS SDK] iPhone 6 Plus を Xcode に追加する
なぜか毎回新規デバイス追加に少し手間取ってしまう。 今回は先日購入した iPhone 6 Plus
-
Apple Event Sep 2022 Far Out
毎年恒例の Apple Event が 2022/09/07 に行われた。日本時間は 9/8 2:
-
タッチ!にほんちずHD Ver.1.1.0 Submit
タッチ!にほんちずHDのバージョンアップ版(Ver.1.1.0)を App Store に提出しまし
-
[iOS SDK] iOS5 の Twitter 機能を利用してみる
iOS5でシンプルツイッター機能をあなたのアプリにも。 | mipoiApp-iPhoneアプリ