PlistReader *pList = [[PlistReader alloc] init];
[pList initWithFileName:@"CountryDetails"];
CountryClass *objcountry =(CountryClass*) [pList getCountryInfoById:countryId];
CCSprite *flag = [CCSprite spriteWithFile:objcountry.ImageUrl];
flag.position = ccp(200, 265);
flag.scale = .255;
NSString *tempdata = objcountry.ShortDetail;//error line sigabrt
TextViewTopFlagData = [[UITextView alloc]init];
TextViewTopFlagData.text = [NSString stringWithFormat:@"this is pakistan"];//countryInfo.ShortDetail;
TextViewTopFlagData.frame = CGRectMake(260,17, 105, 75);
TextViewTopFlagData.backgroundColor = [UIColor clearColor];
[TextViewTopFlagData setEditable:NO];
你好我過得好行錯誤SIGABRT我提到它objcountry.ShortDetail也在這裏NSString的類型,以便它爲什麼得到錯誤SIGABRT任何一個可以幫助越來越sigarbt錯誤
時我把NSString * tempdata = objcountry.ShortDetail;//錯誤線sigabrt之前的精靈線它沒有錯誤,但當我放回精靈線後,它又得到了那個錯誤,所以任何人可以解釋我,
這裏是國家班結構
//CountryClass.h
//
// CountryClass.h
// NationalAntemsAndFlags
//
// Created by mac on 12/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CountryClass : NSObject
{
NSString *Name ;
NSString *ImageUrl;
NSString *AnthemUrl;
NSString *ShortDetail;
NSString *completeDetails;
int LocationX ;
int LocationY ;
}
@property (nonatomic,retain) IBOutlet NSString *Name;
@property (nonatomic,retain) IBOutlet NSString *ImageUrl;
@property (nonatomic,retain) IBOutlet NSString *AnthemUrl;
@property (nonatomic,retain) IBOutlet NSString *ShortDetail;
@property (nonatomic,retain) IBOutlet NSString *completeDetails;
@property (nonatomic) IBOutlet int LocationY;
@property (nonatomic) IBOutlet int LocationX;
@end
//countryClass.m
//
// CountryClass.m
// NationalAntemsAndFlags
//
// Created by mac on 12/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "CountryClass.h"
@implementation CountryClass
@synthesize Name,ImageUrl,AnthemUrl,ShortDetail,completeDetails,LocationX,LocationY;
@end
這是countryClass結構,我也試圖[countryInfo保留],但沒有happend
你能告訴我們 - (CountryClass *)getCountryInfoById:和CountryClass.h嗎? – 2011-12-19 06:11:21
也許加載的精靈導致您的autorelease池清空。嘗試[objcountry retain];在NCString * tempdata之後的CCSprite * flag ...和[objcountry release]之前...如果這不起作用,您將需要在崩潰時顯示更多代碼和調試器輸出 – 2011-12-19 06:44:30
我提供類現在檢查它 – 2011-12-19 08:12:08