I have a view xib that I'm manipulating through IB (for various reasons) and it will be launched as a modal view in code. I have a Toolbar at top and another one at bottom with some other UI elements in between. When I run the app, the placement of the top Toolbar isn't as I see it during the layout in IB.
In IB, the top Toolbar is pla...
Need a GUI with many tabs (TabBarController and UITabBar) and one fullscreen view, e.g. a view with player in the native iPod app. It's possible to show last from any tab.
Currently use last iPhone SDK 3.0.
I tried many approaches, e.g. create Utility and put TabBarController on the flipside, but it throw an exception, because of there ...
Hi,
I'm trying to us a NSTokenField as a representation of a to-many relationship in Core Data. Since binding it directly appears to be impossible, I want to use its delegate method
-(void) controlTextDidEndEditing:(NSNotification *)aNotification;
to ring up the array controller, who should then do all the dirty work of inserting/delet...
Hey all,
So I'm trying to rip URLs from an NSString using RegExKitLite and I came across an odd problem.
NSLog(@"Array: %@", [message componentsMatchedByRegex:@"^(http://)[-a-zA-Z0-9+&@#/%?=~_()|!:,.;]*"]);
NSString *message is just some text with a URL within it. The strange thing is it doesn't work with the ampersand in it. If...
I am trying to save two strings. One string needs to be saved as type ARRAY in the pList and the second string needs to be saved as String in the Array.
I can use the code:
[dictionary setObject:(id)anObject forKey:(id)aKey>]
but it doesn't save it correctly. I can cast one of the strings as an array, but it still doesn't work right.
...
I'm interested in syntax highlighting in a Cocoa TextView.
I found several resources:
approach with flex, via a flex pattern matched against textStorageDidProcessEditing
in a TextView delegate. In this approach the whole string get parsed on each input event, hence performance degrades.
CocoaDev has an own page on the topic of syntax ...
I am trying to render a float value using NSNumberFormatter's SpellOutStyle, but the results are unsatisfactory, and I haven't been able to find a solution so far. The issue is, when given a float value such as 3.2, NSNumberFormatterSpellOutStyle renders it as something like this: "three point two zero zero zero zero zero zero four seven...
I have an NSView subclass which is bound to the arrangedObjects of an NSArrayController. When the array has an item inserted or removed the view is notified. How do I get it to be notified if a model stored in the array has an attribute changed?
Do I need to add my view as an observer to every (relevant) attribute of every item added to...
If I was creating an entity with a non-optional string attribute called, say, "name", I would put "Untitled" as the default. How could I localise this default value?
I could subclass the entity and and use NSLocalizedString in awakeFromInsert to do this. But I was wondering if there was another way.
Edit:
If this is the only way, then...
I'm trying to resize the tableview of a UITableViewController so I can also put some other content in the view. So I'm trying to swap the tableview into a new view. The following works, but if I try to reference self.tableview later, it returns null. What am I doing wrong ?
- (void)viewDidLoad {
[super viewDidLoad];
UIView *...
I'm using a UITableView to allow selection of one (of many) items. Similar to the UI when selecting a ringtone, I want the selected item to be checked, and the others not. I would like to have the cell selected when touched, then animated back to the normal color (again, like the ringtone selection UI).
A UIViewController subclass is ...
I know that the View XIB has a view already in place, but are there any other differences? I've read tutorials which say to create a View XIB, change the class and delete the view, then insert a Table View and remake the connections (File's Owner to the Table View, Table View delegate and datasource back to the File's Owner). Is there an...
I'm new to Mac and Objective-C, so I may be barking up the wrong tree here and quite possibly there are better ways of doing this.
I have tried the code below and it doesn't seem right. It seems I don't get the correct length in the call to FSCreateDirectoryUnicode. What is the simplest way to accomplish this?
NSString *theString = @"M...
I'm trying to introduce a delay between a "touch began" event and an action such as playing a sound. After the threshold has passed, if the user's finger stays relatively stationary, then I hope to increase the volume gradually until the finger is lifted or dragged out of the rectangular area of effect. If it drags out I might play a dif...
Hi,
I'm trying to extend NSImageView so I can delegate the drag/drop responsibility to the controller. It all works fine with the one problem that the compiler is now displaying warnings about sending messages to objects with type id. To solve this I assumed I would simply have to suffix the ivar's type with the name of the protocol. Ho...
I was hoping someone that is good with math and loops could help me out. I'm writing a program in Objective C where I need to come up with a way to do a cycle. If you don't know Objective C I would appreciate any help in pseudo code just to help me figure this out.
What I need is a scale that is based on two dates. I know this will be s...
Hi,
I have this problem with Cocoa, I am calling a function and passing an Array to it:
Some where I call the function:
[self processLabels:labels];
And the function is as follow:
- (void)processLabels:(NSMutableArray*)labs{
labs = [[NSMutableArray alloc] init];
[labs addObject:@"Random"];
....
}
When debugging, I notice...
Why does compare return NSOrderedSame?:
NSString *testString = [anObject aString];
if ([testString compare:@"a string which doesn't equal testString"] == NSOrderedSame) {
//do stuff
}
NB: I added this question so I won't make this mistake again (hence the immediate answer I gave).
...
Hi,
I am new to Obj-C so forgive me if this is a stupid question:
How do I implement some in the style of Javas enums? Or to be more precise:
I want a class with some known properties which are fix at compile time and unique per instance. Additionally I only want one instance type.
Let me give an example in Java:
public enum Message...
I am getting the Error/Warning about a part of my code saying 'Messages Without A Matching Method Signature will be assumed to return 'id' and accept '…' as arguments.)'
I do not understand why I am getting this error, so i am looking for some help, below is a link to that part of code in the implementation file.
http://fwdr.org/h8xf
H...