Interface Builder picking up wrong header file - objective-c

I have two header files with EXACT same name in my project, it seems interface builder is picking the wrong one for "File Owner" dropdown, how can i change it to use the other header file?
Thanks.

Ideally, you should change the name of one of the header files!
Although you can certainly have same-named files in different folders within a project-- and in some cases, such as when you pull in third-party libraries, it'll just happen-- headers that you reference from Interface Builder should be a small subset that are under your control as your UI pieces. You should just rename one of the classes.
(There may be a way to get IB to differentiate, but even if there is, it seems like a fragile setup.)

Related

QlikView Text Object Formatting

I am unable to format the text in a text object. For example, I need headers in bold, while the body of the text could be normal. Can I get any hints on this?
I know this can be achieved via extension objects, but I do not have any experience creating them.
This is not currently possible in QlikView 11. It has been an open development request for quite some time.
You have two options:
Use multiple text objects and lay them over each other (i.e. make the topmost one bold and its background transparent).
Use an extension object, however, this then restricts you to AJAX/WebView for your document. There is an existing extension (written by Stefan Walther) that has this capability here (git repo).

How derive projects from a single project Xcode

I have four different projects which deffer only in a header file and icon files.For making a simple change I have to do it in all the projects.
Is there any way to combine these projects? But I want 4 different applications.
you can make multiple taget.
Click on your project name in the navigator.
In the targets section, duplicate your current target.
Now you can make change in this target, like change icon, package name.
For the header file, you can use preprocessor macros to do this
I'm using this to make 5 versions of an application, which differ only with a .h file.

What's a good way to split a tabbed UITableViewController into multiple files?

I've implemented a tabbed UITableViewController. There are some tabs on the top which reload the contents of the table. Based on the selected tab different cells are shown to the user. It all works nice, but I end up with a source file which contains 3 different implementations, and gets a little bit bulky and confusing, even using pragmas to mark sections of the source code.
I've thought of creating selectors at runtime from strings based on the selected tab, then splitting the .m file into several putting there the renamed methods, but then there's the forced #end and the end of a file and the compiler telling you that there are missing methods to be implemented.
Really, it looks like objective-c wasn't designed to split the source though several files. Is there any design pattern that can be used for this? Somehow I managed to emulate all this using #include <otherfile.m> before the #end of the main class, but it doesn't look pretty. Also, Xcode gets confused as hell if I try to include that file into the project, since it tries to compile it separately (at least I can include the files in the project and disable their inclusion in the target).
In the end I have resorted to the basic preprocessor, meaning includes and some trickery. Here's what I've done:
Given a table view controller filename.m, create one filename_functionality.m file for each tab/group of related functionality and put there the methods. Note that there is no #implementation, #end, #include, etc, in this file, just the methods.
In your Xcode project add the new files, but be careful to not mark them as required for any build targets. If you forget, select later the files and uncheck the mark which includes them into your target. This is to avoid Xcode trying to compile these rouge files alone.
At the end of your main filename.m and just before your #end marker, add the necessary #include "filename_functionality.m", which effectively tells the preprocessor to treat all the files as a single one.
For the cases where your main file is calling methods of your subordinate files, add to the top of your main file an anonymous interface and declare there the prototypes of the methods you moved to the other files.
At this point, it works! However, Xcode is still really annoying, despite being able to open the subordinate source code files, it doesn't parse them properly, so you can't use the quick navigation bar to jump between methods, for example. Again, to solve this more preprocessor trickery:
At the beginning of each subordinate file, add (yuck, wiki formatting is broken):
#ifndef _INCLUDE_FILES
#implementation BIEntity_view_controller
#endif
At the end of your subordinate file repeat with ifndef enclosing an #end.
At the end of your main file and before the includes, define _INCLUDE_FILES.
What this does is trick XCode into thinking that this is a proper implementation file, so syntax highlighting, completion and navigation bars work as expected.
The only minor nit with this setup is that Xcode doesn't properly report errors for lines in your subordinate files, it just points to the include and stays there. Now I have to right click on the line error and select Reveal in Log which sows the full console message where the correct line numbers are.
This is not a big problem if you don't write bad code (hehe) or use an external text editor anyway, but will seriously hurt if you are used to the quick fix keys to jump from one error line to another.
With this trick I've split a 1151 line file into four of sizes 558, 342, 55 and 145 lines each. Now the functionality is better related and the code can still work as part of the same class, so I don't need to write accessors as would be the case if using a language construct like classes or interfaces.

Silverlight 4 MVVM app, resx editing by user, Blend only?

In a Silverlight 4 app, our user base needs to define for us what content they want on buttons, labels, various screen text, etc. I understand the methods of resource files, but what i'm wondering is when wanting to give that kind of control to the users to define the text in the resource file, what is the best way to let them do that in a way that they can view their changes to the XAML pages? Do they need to have Blend installed?
I vaguely remember when doing a WinForms app, at one point I handed off to the users the actual winform, and they used some sort of visual designer to edit button text, labels, etc., and those changes were then saved to the resource file.
Our app is MVVM, so each item in the XAML would bind to a property in its view model, and that property would then load the entry from the resource file.
If there is a way to let the user update the contents of the resx file while visually reviewing their changes please let me know.
Thanks very much in advance for any assistance.
What I have done in the past is to have a dedicated assembly for Resources (resx) files. By default, they are "embedded" into the assembly. The trick is to change the property on the resx file to NOT be embedded (False). This way, the files are separate resx xml files that must go with the assembly (and live in the same /bin directory of the running application). This is what you see in some /bin directories with the /en-US/ and other resources. In the past, I have created a simply GUI for users to be able to edit these resx files that gets written back to disk. I am not familiar with Silverlight's inner workings for this type of permissions needed, but I would guess at worse case the edited resx files just get uploaded to a server where a new copy is downloaded on next app restart or alike.
Now, when I said "in the past", that was back in 2003 days. Recently I had to do this manually using the ResXResourceReader because of an existing assembly I could not modify.
Some example code (writing it from memory, completely untested):
using (var reader = new ResXResourceReader("[path-to-bin]/MyResources.resx"))
{
var value = reader["My_key_in_the_resx_file"].ToString;
}
Do note that by going this route, you do have access to other types of resources such as binary and files embedded int he resx files.
Lastly, watch your encoding formats. Some over-seas editors use UTF16. So going with a common Unicode converter may be needed.
Also note there is a ResXResourceWriter class, should you want to roll your own writers for updating the resx files through code.

Are Objective-C function names stored in text?

I don't remember where I heard about it, (I think I was searching up on how selectors worked and it ended up not being exactly the same as a callback function) and I can't confirm it. But more importantly than that, is there a way I could get a list of the function names from another application?
See class-dump.
You can sometimes see a list of the method names in an application. Find the .ipa file for the app (possibly in the Music->iTunes->Mobile Applications directory on a Mac). Make a copy of one of the ipa files and change it from .ipa to .zip. Unzip the file and in the Payload folder, there's a file with the same name as the app. Right click on it and "Show Package Contents". In there, you'll find another file with the same name as the app (with no extension). This is the executable file for the app. If you open it in a text editor like BBEdit, you'll sometimes be able to see some method names, as well as a list of the frameworks the app is built against. You can find the path name where things were kept too, often with the developer's name.
For example, looking into the Japanese dicitonary Daijirin, I can see these methods:
-[HMWebSupport openMONOKAKIDOSupportWithSafariForView:style:]
-[HistoryViewController viewWillAppear:]
I can also see that one of the developers was called Norihito, and he was using SVN: /Users/norihito/Developer/SVN/Mobile/DAIJIRIN/Other
Other applications (like Weightbot) don't show as much information. I don't know the reason it shows up some times and doesn't other times.