Places というクラスがあり、placeId は Int として宣言されています。
int placeId;
私のplaceId /を返すメソッドがあります
- (int) getPlaceId;
- (int)getPlaceId{
return placeId;
}
Places オブジェクトをその配列に格納するための arrayList を作成しました。このメソッドを実行して placeID を取得すると、一連の奇妙な数字が返されるようです。例えば。1234567。
なぜこれが起こっているのですか?
NSString *tempInt = [tempObject objectForKey:@"placeId"];
NSString *tempString = [tempObject objectForKey:@"name"]; //2
//convert temptInt to integer
NSInteger myInt = (NSInteger)tempInt;
Places *p = [[Places alloc]set:myInt andb:tempString];
[del.delegateArrayPlaces addObject:p];
追加する方法は次のとおりです。他にどのようなコードが必要ですか?