English 中文(简体)
扼杀 支出 非工作形式
原标题:stringByAppendingFormat not working

我有一份叙文,没有适用以下声明:

NSString *myString = @"some text";
[myString stringByAppendingFormat:@"some text = %d", 3];

没有任何原木或错误,只是表面上的变化。 我已经与国家安全局(有文件记载)和国家安全局统计处进行了审判。

任何令人非常欢迎的内容。

最佳回答
问题回答

工作时,你只是无视收益价值,即随附格式的描述。 (见 docs ) 您可以修改国家抽样调查——修改国家抽样调查,使用-appendFormat:

当然,以你为榜样,你可以缩短:

NSString *myString = [NSString stringWithFormat:@"some text = %d", 3];

然而,你很可能需要用一种形式来说明在其他地方建立的现有结构。 在该案中,特别是如果你重新使用多个部分,那么,最好考虑和平衡使用一种可变的扼杀或几种可变的自动释放装置的利弊。

采用<代码>@”创建“,总是产生不可改变的扼杀。 如果你想设立一个新的国家安保委员会,则如下。

NSMutableString *myString = [NSMutableString stringWithString:@"some text"];
[myString appendFormat:@"some text = %d", 3];

我有类似的警告信息,同时看到了局部的扼杀。 这是我是如何解决的。

NSString *msgBody = [msgBody stringByAppendingFormat:@"%@",NSLocalizedString(@"LOCALSTRINGMSG",@"Message Body")];




相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签