Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have the code of an application but inside it there aren't ".m" files, but app works fine and runs on device; is it possible? I don't understand this fact, can you explain me this case?
If the app is calling into a file with one .a suffix, that means it's an already compiled library and the original source code is on the original author's machine.
You can ask him/her nicely for the source code to that .a library but unless it's open source, chances are high they're not going to provide it.
Using the "nm" tool to get the exported symbols is one trick, but whatever API's you're supposed to use in the library are probably visible and documented in the .h file.
You can put the #interface and #implementation code in 1 .h-file no problem. It will still work and if you do it doesn't need a .m-file.
The seperation between .h and .m is just default by xcode but not mandatory to stick to as you can see.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 days ago.
Improve this question
I recently wanted to use an open source library that dropped Cocoapods support so I decided to migrate my entire project over to using Swift Package Manager. That means no more using the .xcworkspace file and now opening the .xcodeproj file instead. Is there a difference among settings that occurs when using the .xcodeproj instead? I noticed my project is always indexing first thing when I open it and when I build my project Xcode jumps to 110% CPU utilization and stays there even after the build and is idle. This makes the experience inside Xcode a bit laggy. Anybody else experiencing this? Is this expected? What’s the best way to go about trying to figure out what’s going on?
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I want to migrate my old app from objective-c to swift by re-starting the swift project from the scratch.
I wish to use the same package name and app icon.
All the migration tutorials tell me to do bridging work between objective-c and swift. But I just want to restart using swift. Start anew.
Is there a way to do this?
Would simply erasing all storyboards, .h and .m files(and create anew using swift) work?
To be more specific, I was stuck at replacing AppDelegate.h, .m with AppDelegate.swift, which uses Core Data.
If you literally want to start again from scratch then do just that. Make a brand new project but use the same bundle identifier, that way when you send it to the app store it will update the original app. I did this recently with an old app of ours on the store and it worked perfectly.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
In an iOS project, if I wanna use an image, I should add a file reference to project navigator, it's not so convenient when there are many images to be included, is there any way to include all images automatically ?
If you are targeting iOS 7+ there is really one answer - you really should
use assets catalogs. You might find this tutorial and of course the primary source.
Is a way to include all your images automatically? Well if you have all you images in one directory, you can drag&drop it to “assets catalog” view and that should be it - they all will be organised nicely so you will see what is missing, given that you named your assets properly (“~ipad”, “#2x”, “#3x” suffixes etc.). Although assets catalogs allow you much more.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
In working on an iPhone application, what is a good method for working with multiple developers? I have run into several git conflict from simultaneous modifications to the Storyboard file. Is there a good method around this?
The storyboard files are stored as XML so you're going to run into the same types of issues that XML files have when tracked with git.
Check out this answer for more technical info on using git attributes and custom merge drivers
Storyboard XML is not that hard to read from a human perspective (compared to old XIB files) so if the changes are small and not on the same object it can be trivial to use the merge tool in Xcode to resolve conflicts.
To avoid the conflicting situations as much as possible you could set up your project to use multiple storyboard files to split things up and minimize the chances for conflicting changes to a single large storyboard. Use +storyboardWithName:bundle: to load the storyboards when needed.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Just something I've noticed: when you create new files in XCode that are not a subclass of a controller, there is no #interface in the .m file by default. I'm going to assume that's done intentionally - I'm curious as to why that is
I was thinking that possibly its because they're making the assumption that you're going to want most of your properties to be publicly accessible for parent controllers and the likes?
I've tried researching this to no avail - help me out SO! :D
I think I'd generally be wary of trying to draw any conclusions from Apple's template files - a lot of their sample projects and project templates don't really follow best practices. For example, if you create a project with Core Data, the template has all of the Core Data code within the app delegate - somewhere it really doesn't belong.
On the topic of including an #interface class extension within the .m file - I usually have these in most classes, and keep all properties / methods private unless they definitely need to be visible to another class.