2011-03-24 6 views
0

내가보기간에 데이터를 전송하려면,하지만 난이 오류가 발생합니다 : 인식 할 수없는 선택 ....NSCFNumber 인식 할 수없는 선택

및 디버거에서 변수 mystring에가 NSCFNumber는 ("이것이다 시간 ") 대신있는 NSString의 ...

allergy_appAppDelegate.h

#import <UIKit/UIKit.h> 

@interface allergy_appAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> { 
    UIWindow *window; 
    UITabBarController *tabBarController; 
    NSMutableArray *result_array; 
} 

@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; 
@property (copy , readwrite) NSMutableArray *result_array; 

@end 

viewcontroller.m

 allergy_appAppDelegate *dataCenter = (allergy_appAppDelegate *)[[UIApplication sharedApplication]delegate]; 
     dataCenter.result_array = [[NSMutableArray alloc] initWithArray:Parser_result]; 
,

result.m

allergy_appAppDelegate *dataCenter = (allergy_appAppDelegate*)[[UIApplication sharedApplication]delegate]; 
    show_user_array = [[NSMutableArray alloc] initWithArray: dataCenter.result_array] 

for (NSString *mystring in show_user_array) {   
    textView.text = [[textView text] stringByAppendingString:@"\n"]; 
    textView.text = [[textView text] stringByAppendingString:mystring]; 
} 

답변

0

인스턴스 변수에는 낙타가 있어야하며 _이 없어야합니다. 나는. result_arrayresultArray이어야합니다. 클래스는 대문자로 시작합니다.

결과 배열의 인스턴스가 NSString 또는 NSNumber (또는 필요한 경우)으로 가득 찼습니까? 여기 배열을 누출되는 것을 감안할 때

...

dataCenter.result_array = [[NSMutableArray alloc] initWithArray:Parser_result]; 

는 ... 과잉 방출 문제 같지는 않다. 또한 copyNSMutableArray은 원하는대로 처리하지 않습니다 (컴파일러에서 플래그를 지정해야하지만 그렇지 않습니다). -copy은 항상 클래스 클러스터 인스턴스의 변경 불가능한 복사본을 반환합니다.

+0

배열은 NSString 인스턴스로 가득 차 있습니다 ... 읽기 - 쓰기 속성을 시도했지만 성공하지 못했습니다 .. – Phil

+0

아무도 아이디어가 없습니까? – Phil

+0

전체 오류 메시지와 백 트레이스를 게시하십시오. – bbum

관련 문제