当我通过管理器将我的配置文件添加到Xcode时,我可以看到该配置文件仅设置为3个月的持续时间.
我的问题是,如果我使用上述配置文件将应用程序部署到测试设备.在设备上安装了3个月的应用程序后,如果我打开应用程序它是否可以正常运行,或者应用程序因配置文件过期而无法加载?
它通常如何工作?
我有点进退两难.我已经在我的项目中添加了2个框架,所以它恰好都使用了JSONKit.所以当我编译我的项目时,我在这两个框架之间得到了重复的符号.
我不得不将-ObjC -all_load添加到我的构建设置中,否则由于某些类别未编译而导致运行时错误(崩溃).
有任何想法吗?
我不确定我的问题究竟是什么,因为我现在已经使用这种方法一段时间了,从来没有遇到过这个问题.
基本上,正如标题所说.此代码从位于"Resources"组中的plist加载数据
NSString *myFile = [[NSBundle mainBundle] pathForResource:@"myList" ofType:@"plist"];
myArray = [[NSArray alloc]initWithContentsOfFile:myFile];
NSLog(@"%@", myArray);
Run Code Online (Sandbox Code Playgroud)
它显示(null).谁知道为什么?
我在同一个ViewController中有另一个设置并且工作得很好.然而,这个特定的钳子不会加载.我甚至还删除了plist,只是从另一个创建了一个副本,以确保不是结构问题.
我做错了吗?我应该使用FileManager吗?
更新------------------------------------------------- ------------------------
好吧,我无法相信我要说的话.大声笑
我正在使用XCode 4,你在Xcode中编辑plists的方式与Xcode 3.x不同.和早期版本一样,你可以选择你想要的plist的根(数组,字典等)我的问题是我试图加载到NSArray中的plist实际上是一个结构化的字典.但是我从来没有在Xcode中看到这个,除了使用TextEdit或其他文本编辑器浏览内容之外,我不知道如何看到这个.
我必须说,很傻.有谁知道为什么XCode 4不会像XCode 3.x那样显示plist的根?
XCode 3.x:http://dl.dropbox.com/u/919254/XCode3.png
XCode 4:http://dl.dropbox.com/u/919254/Screen%20shot%202011-04-10%20at%202.30.35%20AM.png
现在,我的班级看起来像
@interface Character : SKNode
@property (nonatomic, assign) CGFloat walkingSpeed;
Run Code Online (Sandbox Code Playgroud)
@implementation Character
+(Character*)characterWithLevel:(BaseLevel *)level {
return [[self alloc] initWithLevel:level];
}
-(id)initWithLevel:(BaseLevel*)level {
if (self = [super init]) {
_sprite = [SKSpriteNode spriteNodeWithImageNamed:level.heroTexture];
_sprite.position = level.heroStartingPosition;
[self addChild:_sprite];
[level addChild:self];
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
问题是,当对级别中的Character节点运行操作时,由于SpriteNode是动画的,因此它不会做任何事情.我想知道你们怎么会遇到这些问题?
行动举例:
触摸事件:
CGPoint location = [[touches anyObject] locationInNode:self];
[character moveToPosition:location];
Run Code Online (Sandbox Code Playgroud)
里面的角色类
-(void)move {
[self runAction:[SKAction repeatActionForever:[SKAction animateWithTextures:[self walkFrames]
timePerFrame:0.1f
resize:NO
restore:YES]] withKey:@"moving"];
return;
}
Run Code Online (Sandbox Code Playgroud)
这没有任何作用.只有我可以让它工作的方法是如果Character是SKSpriteNode的子类.对self.sprite运行操作似乎也有点hacky并且节点本身不会移动.
有什么建议?
我正在连接到一个基本上返回XML的远程Web服务.然后我将该XML解析为Property对象(想想真实的状态)
但现在,Web服务仅返回每个属性的邮政编码.它没有提供我需要在地图中放置注释的坐标.我能够为邮政编码提供地址代码.但是,我的问题是它不允许我做多个请求
这是我的代码
- (void)processProperties:(Property *)property {
[geocoder geocodeAddressString:property.postalCode
completionHandler:^(NSArray* placemarks, NSError* error){
placemark = [placemarks lastObject];
for (CLPlacemark* aPlacemark in placemarks)
{
[sublet setLatitude:aPlacemark.location.coordinate.latitude];
[sublet setLongitude:aPlacemark.location.coordinate.longitude];
}
}];
}
- (void)addAnnotations:(NSArray *)objects {
CLLocationDegrees lat;
CLLocationDegrees longitude;
CLLocationCoordinate2D mCoords;
NSString *fullAddress;
// Add the annotations found nearby
for (Property *property in objects) {
[self processProperties:property];
lat = property.latitude;
longitude = property.longitude;
fullAddress = [NSString stringWithFormat:@"%@ %@ %@", property.houseNumber, @" ", property.streetName];
[self createAnnotationWithCoords:mCoords :fullAddress :[NSString stringWithFormat:@"$%.2f", property.rent]];
} …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将多个表连接在一起,但是当某些产品有超过1张图片附加它们时,我遇到了一些麻烦.
Products Pictures
Id pic_id
name pic_name
picture_id
Run Code Online (Sandbox Code Playgroud)
我的查询:
SELECT id, name, pic_name
FROM Products
LEFT OUTER JOIN Pictures p ON id=pic_id
Run Code Online (Sandbox Code Playgroud)
这显示了类似的东西
1 RAM ram.png
1 RAM ram2.png
1 RAM ram4.png
2 CPU test.png
Run Code Online (Sandbox Code Playgroud)
我想展示类似的东西
1 RAM ram.png, ram2.png, ram4, png
2 CPU test.png
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激!
是否可以为UIKit控件提供自定义颜色代码?
通过传递十六进制颜色值或使用RGB值?
刚刚在文档中注意到有一个initWithRed:green:blue:alpha:方法
任何获取十六进制代码的方法?
ios ×4
ipad ×2
objective-c ×2
app-store ×1
clgeocoder ×1
database ×1
frameworks ×1
geocode ×1
ios5 ×1
iphone ×1
llvm ×1
mysql ×1
nsarray ×1
plist ×1
profile ×1
sdk ×1
sprite-kit ×1
sql ×1
uikit ×1