Yusuf OZKAN
Yusuf OZKAN

Reputation: 115

How can i change display name with code

I want to dynamically change display name from within the application. Is there a way it? i dont want to use .plist. i want to use with xcode from application. Thanks

${PRODUCT_NAME} How can i call this value with code ?

Upvotes: 2

Views: 3512

Answers (3)

sree_iphonedev
sree_iphonedev

Reputation: 3534

No, it's not possible. The Info.plist and everything in the app bundle is read-only once it's installed on an iPhone.

Add the following code to get the product name

NSDictionary *infoPList = [[NSBundle mainBundle] infoDictionary];
NSString *appName = [infoPList objectForKey:@"CFBundleDisplayName"];

appName is the value of "Bundle display name" or Product Name

Upvotes: 4

Shubhank
Shubhank

Reputation: 21805

The app name is defined in the app's info.plist file..

That come in Main Bundle..and iOS does not allow anything to be written and updated in Main Bundle..

So you cant programmatically change contents of app info.plist having app's name...bundle identifier ..etc

Upvotes: 8

Stephen Darlington
Stephen Darlington

Reputation: 52565

I don't believe so.

You can localise it -- i.e., display different names depending on the language in use -- but I don't think you can change the name dynamically. That's probably a good thing... it could get pretty confusing if abused.

Upvotes: 3

Related Questions