我需要在两天内翻译一个iOS应用程序,但我的XCode版本(4.4和4.5开发人员预览版)都没有给我添加另一种语言的选项.我只能选择单击"Make localized .."但我只能选择英文,在选择之后,Xcode中的实用程序检查器中没有加号和减号按钮 - 没有我试过的文件或项目.
我在这里错过了什么吗?
编辑: 这是它的样子:

我昨天开始将iAd实施到一个新的应用程序中.但从那以后从问题标题中获取错误.有谁知道我怎么解决它?
我在这里读到可能是苹果的错.但由于该线程已经相当陈旧,而且我目前无法在Apple Dev论坛上找到关于它的讨论,我不认为这是苹果方面的一般性问题.此外,问题不在于他们目前没有足够的广告展示,因为这只会影响实时广告.
更多信息:
我确实在iTunes Connect中为该应用启用了iAd Networking.
该应用程序甚至出现在iTunes Connect的iAd货币化摘要中.其"广告状态"设置为"测试广告"(带有黄色标记),但"请求"计数为0.
我想POST使用JSON数据类型的方法将在iOS上创建的新对象发送到接收服务器.根据我对从 iOS服务器接收数据的了解JSON,苹果公司通过iOS 5的引入简化了所有处理.但与GETting JSON对象相比,POST这些并不是我能找到的任何地方.
我尝试解决问题的第一步看起来如下:
//build an info object and convert to json
NSDictionary *newDatasetInfo = [NSDictionary dictionaryWithObjectsAndKeys:name, @"name", language, @"language", nil];
//convert object to data
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:newDatasetInfo options:kNilOptions error:&error];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:someURLSetBefore];
[request setHTTPMethod:@"POST"];
// any other things to set in request? or working this way?
[[NSURLConnection alloc] initWithRequest:request delegate:self];
// What to do with NSURLConnection? Or how to send differently?
Run Code Online (Sandbox Code Playgroud)
但我真的不知道如何使用POST方法将JSON对象发送到服务器.有人可以帮帮我吗?
好的,这是我的测试类中的代码:
- (NSManagedObjectContext*)managedObjectContextWithConcurrencyType:(NSManagedObjectContextConcurrencyType)concurrencyType {
NSManagedObjectModel *mom = [NSManagedObjectModel mergedModelFromBundles:nil];
STAssertNotNil(mom, @"Can not create MOM from main bundle");
NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom];
STAssertNotNil(psc, @"Can not create persistent store coordinator");
NSPersistentStore *store = [psc addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:0];
STAssertNotNil(store, @"Can not create In-Memory persistent store");
NSManagedObjectContext *moc = [[NSManagedObjectContext alloc] initWithConcurrencyType:concurrencyType];
moc.persistentStoreCoordinator = psc;
return moc;
}
Run Code Online (Sandbox Code Playgroud)
这是尝试在测试方法中使用该方法时的失败消息:
Undefined symbols for architecture i386:
"_NSInMemoryStoreType", referenced from:
-[CrosswordItemTests managedObjectContextWithConcurrencyType:] in CrosswordItemTests.o
"_OBJC_CLASS_$_NSEntityDescription", referenced from:
objc-class-ref in CrosswordItemTests.o
"_OBJC_CLASS_$_NSManagedObjectContext", referenced from: …Run Code Online (Sandbox Code Playgroud) 我想静态地将ADBannerView对象放在我的UITableView屏幕上,这意味着我希望它始终保持在我的工具栏上方(self.navigationController.toolbar),即使用户正在滚动tableview.我已经通过将ADBannerView作为子视图添加到我的工具栏中来解决这个问题,并给出了帧原点的负值:
[self setBannerViewSize];
[self.navigationController.toolbar addSubview:bannerView];
Run Code Online (Sandbox Code Playgroud)
唯一的问题是:我无法点击并以这种方式打开iAd - 我可以看到横幅,但是当我点击它时没有任何反应.
因为我也使用了refreshControl,所以使用UIViewController而不是UITableViewController并手动添加tableView的选项对我来说不起作用.有没有其他方法可以让我的ADBannerView静态显示在我的表视图控制器中并且仍然可以点击?
谢谢你的建议!
我一直在尝试在iOS应用程序中进行一些模拟计算,但是我的手机会随着时间的推移而内存不足,它只是不会停止添加内存使用量,虽然我知道这种情况发生在哪里(用仪器钉它)我仍然不喜欢不知道我需要改变什么来阻止内存泄漏.
这是内存分配发生的方法,我知道我在这里添加新数据,但我认为ARC将释放所有我不能再引用的分配数据?
int round = 0;
InstanceInSimulation *simulatingChosen = [[InstanceInSimulation alloc] initWithSimulationInstance:_chosenInstance];
InstanceInSimulation *simulatingOpponent = [[InstanceInSimulation alloc] initWithSimulationInstance:_opponentInstance];
while (round < _maxRounds) {
// first choose action
NSManagedObject *chosensAction = [simulatingChosen nextActionAgainstOpponent:simulatingOpponent];
NSManagedObject *opponentsAction = [simulatingOpponent nextActionAgainstOpponent:simulatingChosen];
// second calculate which action first
InstanceInSimulation *attackingFirst;
InstanceInSimulation *defendingFirst;
NSManagedObject *attackingFirstsAction;
NSManagedObject *defendingFirstsAction;
if (simulatingChosen.instance.speed > simulatingOpponent.instance.speed) {
attackingFirst = simulatingChosen;
defendingFirst = simulatingOpponent;
attackingFirstsAction = chosensAction;
defendingFirstsAction = opponentsAction;
} else {
attackingFirst = simulatingOpponent;
defendingFirst = simulatingChosen;
attackingFirstsAction = opponentsAction; …Run Code Online (Sandbox Code Playgroud) memory-leaks objective-c ios xcode-instruments automatic-ref-counting
我正在获取JSON对象并将它们保存在NSString中,如下所示:
// fetch JSON from a Wiki article
NSError *error = nil;
NSString *responseString = [NSString stringWithContentsOfURL:myURL encoding:NSUTF8StringEncoding error:&error];
Run Code Online (Sandbox Code Playgroud)
这是一般的工作但我的responseString充满了\u####转义字符,我想要的是相应的UTF8字符,例如\u2640应该是?.
解码我的所有转义字符的最简单方法是responseString什么?
更新:
我在某处读到了我应该尝试使用JSON NSNonLossyASCIIStringEncoding而不是NSUTF8StringEncoding,但这会导致错误,所以我根本没有得到responseString它.
那么错误是:
Error Domain=NSCocoaErrorDomain Code=261 "The operation couldn’t be completed. (Cocoa error 261.)"
Run Code Online (Sandbox Code Playgroud) ios ×5
adbannerview ×2
ios5 ×2
json ×2
objective-c ×2
xcode ×2
button ×1
core-data ×1
decode ×1
frameworks ×1
http ×1
iad ×1
ios6 ×1
localization ×1
membership ×1
memory-leaks ×1
ocunit ×1
parsing ×1
post ×1
static ×1
subview ×1
target ×1
uitableview ×1
webserver ×1
xcode4.5 ×1