Reputation:
I know there are so many answers related to my question, such like.
Programmatically rename an XCode project
Renaming xcode 4 project and the actual folder
etc.
But look at following my code:
NSString *plistPath = @"...../TestingAPI-Info.plist";
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]initWithContentsOfFile:plistPath];
[dictionary setObject:@"myTestingApp" forKey:@"CFBundleDisplayName"];
[dictionary writeToFile:plistPath atomically:YES];
I am changing the name of apps icon by above code,
Changed name "MySuperApp => myTestingApp"
SO, Is it valid to change by using above code ? I have fear of app rejection ?? I also want to set all changes through above code like, Bundle identifier, Bundle name..etc ?
Is it valid or not ?? By using above code apple reject my application or not ??
Upvotes: 5
Views: 1304
Reputation: 9977
As rckoenes said correctly, this won't work on the device. Any bundle contents are readonly, including the info.plist. You can not overwrite it.
To clarify:
Just open up the Info.plist file in Xcode and rename it to whatever you want. You don't need any code for this. You will find the YourProjectName-Info.plist
file within your Xcode project.
Upvotes: 4
Reputation: 13222
The writeToFile
call will not work i.e. the contents will never get update in the Info.plist
file. API call may return a false success but contents of that file will never change since application bundle is read-only (obviously the contents within it as well).
As per Appstore review guidelines there is one which suggests,
2.6 Apps that read or write data outside its designated container area will be rejected.
But whether app bundle falls under "designated container area" is a matter of speculation because only Apple can clarify this. AFAIK I have not read anywhere about app getting reject for attempting to write into application bundle.
As a side note: It may not be a good idea to change application name randomly without the users consent.
Hope that helps!
Upvotes: 2
Reputation: 2185
This is very unusual, app name is your brand it is finalized with lot of suggestions and thinking. What is benefits of this and why is your requirements to change name likewise.
Upvotes: 0