iPhone – Best Practice for Management Related iOS Application Series

I am currently adapting an existing iOS application to a series of very similar applications (each application instance may be mapped to a different country/region).

I plan to set different build targets for each instance, the only difference between them should be:

>Image (maybe just splash screen and icon)
>Local
>String variables: the basic URL of the remote service, application ID, support email, etc. (there may be six such variables)

The code itself should be the same on all applications.

What I want to know is what you think is the best practice for managing this type of application.

Regarding images and localization (or general resources), it should just be added/removed from the target Appropriate files (I think I can even use the same name in different directories).

What I’m not sure about is mainly other configuration variables.

I have heard of/thought of Several options:

>Use preprocessor macros and main configuration header files and different URLs, IDs, etc.
>load them from the plist (or similar configuration file) whenever the application starts And each target has one such file
>Create an empty .sqlite file (this application has used Core Data) and fill it with default configuration variables, and set up one such file for each target< /p>

I think the first option is that once I have some instances of this application, it will get out of control the fastest, and I have to recompile every time I change one of the settings.

Third I’m not sure about this option, because I will add entities to my database, these entities don’t feel they belong there, and it’s a bit like overkill. It may be 5-10 settings. I am also not sure how to add on the update New setting.

So I prefer the second option.

Thinking? Alternatives to these?

Update #1:

As for the second option, there is another disadvantage that these strings (ID, URL, etc.) will be slightly exposed (that is, if someone opens the application And look at the plist) instead of them in the source code. It’s not that this is a big problem, but it’s just something to consider.

Update #2:

How to directly use the info.plist of the application and store it there? (So ​​there is an info.plist for each target configuration) Although what I originally thought was to have a separate plist and a “configuration singleton” to load everything from startup, I thought it might be simpler to simply have it In info.plist, then read it through [[[NSBundle mainBundle] infoDictionary] objectForKey:@”com.example.mykey1″].

< /div>

I will use the preprocessor option. You can put all the preprocessors in one file/method, it won’t be too messy. As oefe said, change. SQLite is A bit too much. With multiple plists, you will find yourself dragging things and doing a lot of error-prone actions.

However, I don’t make many applications. I just want to make one The application allows the user to select his city at startup. You can also add in-app purchases so that users can add more cities when they need it.

>Your application will be easier to maintain: Are you Want to upload and change the description and screenshots of 10 apps every time you update? I found the pain of 1 app…>You will not send spam to the AppStore: It is ridiculous to add 10 more apps with the exact same purpose to the AppStore…This is exactly what Apple did to avoid this situation Reasons for in-app purchases.> You have to find different icons for each city: your icon is one of the most important aspects when selling apps on the AppStore. You want it to be as polished as possible. Apple does not allow multiple Applications have the same icons, and it is not a good choice to distinguish icons by adding tags on them.

I am currently adjusting the existing iOS application to one Series of very similar applications (each application instance may be mapped to a different country/region).

I plan to set different build targets for each instance, the only difference between them The difference should be:

>Images (maybe just splash screens and icons)
>Localization
>String variables: the basic URL of the remote service, application ID, support email, etc. ( There may be six such variables)

The code itself should be the same on all applications.

What I want to know is what you think is the best practice for managing this type of application.

Regarding images and localization (or general resources), it should just add/remove appropriate files from the target (I think I can even use the same name in different directories).

I’m not sure about other configuration variables.

I’ve heard/thought of several options:

>Use preprocessor macros and main configuration header files and different The URL, ID, etc.
>load them from the plist (or similar configuration file) whenever the application starts, and each target has one such file
>create an empty .sqlite file (this The application has used Core Data) and filled it with default configuration variables, and set up one such file for each target

I think the first option is once I have some instances of this application, the most It’s getting out of control, and I have to recompile every time I change one of the settings.

The third option, I’m not sure, because I will add entities to my database, and these entities don’t think They belong there, and it’s a bit like overkill may be 5-10 settings. I am also not sure how to add new settings on the update.

So I prefer the second option.

Thinking? Alternatives to these?

Update #1:

As for the second option, there is another disadvantage that these strings (ID, URL, etc.) will be slightly exposed (that is, if someone opens the application And look at the plist) instead of them in the source code. It’s not that this is a big problem, but it’s just something to consider.

Update #2:

How to directly use the info.plist of the application and store it there? (So ​​there is an info.plist for each target configuration) Although what I originally thought was to have a separate plist and a “configuration singleton” to load everything from startup, I thought it might be simpler to simply have it In info.plist, then read it through [[[NSBundle mainBundle] infoDictionary] objectForKey:@“com.example.mykey1”].

Me The preprocessor option will be used. You can put all the preprocessors in one file/method, and it won’t be too messy. Like oefe said, changing .sqlite is a bit overkill. Use multiple plists and you will find I drag things by myself and do a lot of error-prone actions.

However, I don’t make many applications. I just want to make an application that allows the user to select his city at startup .You can also add in-app purchases so that users can add more cities when needed.

>Your app will be easier to maintain: do you want to upload and change 10 apps every time you update Instructions and screenshots of the program? I found the pain of 1 app…>You will not send spam to the AppStore: It is ridiculous to add 10 more apps with the exact same purpose to the AppStore…This is exactly what Apple did to avoid this situation Reasons for in-app purchases.> You have to find different icons for each city: When selling apps on the AppStore, your icon is one of the most important aspects. You want it to be as polished as possible. Apple does not allow multiple Applications have the same icons, and it is not a good choice to distinguish icons by adding labels on them.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1104 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.