KVOの受信できなくてハマった
自作クラスのプロパティ(NSArray)を登録したのに呼ばれない
//[self.tweets insertObject:statuses AtIndex:0];
//↑コレじゃ更新したことにならないみたいで
//↓これならOKだった
[self setValue:@[statuses] forKey:@"tweets"];
KVOでデータ更新したのを受信してLabelとか書き換えたのに画面更新しなくてハマった
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
// [self reLoad:nil];←コレで更新しようと思っても再描画されない
// ↓別スレッドで更新メソッド呼んだら瞬時に終わった
[NSThread detachNewThreadSelector:@selector(reLoad:)
toTarget:self
withObject:nil];
}
ACAccountStore使いたいのに認証確認画面を呼んでくれなくてハマった
requestAccessToAccountsWithTypeを呼ぶ
//[self.accountStore accountsWithAccountType:_twitterAcType];
//↑これがnilになるのに認証確認してくれない
//↓ requestAccessToAccountsWithTypeを呼んだら認証してない時に確認画面を表示してくれる
[self.accountStore
requestAccessToAccountsWithType:_twitterAcType
options:NULL
completion:^(BOOL granted, NSError *error) {
if (granted) {
NSLog(@"outhentication:OK");
}else{
NSLog(@"%@", [error localizedDescription]);
}
}];
UiViewがtouchesBeganとかtouchesEndedを取得できなくてハマった
結論から言うと、UIScrollViewはタッチイベントを取得できない仕様らしいです。
以下で解決
Objective-C - UIScrollViewに追加したUIImageViewのタッチイベントを取得する - Qiita [キータ]