Hello,
I learning Objective-C in Linux(Ubuntu), but when i tryed to compile my application that needs the Foundation headers i got an error saying that the file cannot be found, but i have installed the GNUstep development package(gnustep-devel). Here is my code:
// Fraction.h
#import <Foundation/NSObject.h>
@interface Fraction: NSObj...
In Objective-C I need to associate a mutable collection integers (monotonic, non-contiguous, could get fairly large) to boolean values. The obvious way is just to have an NSDictionary w/ NSNumbers as keys and values.
Is there a better way that doesn't involve so much object creation? I'm really not trying to pre-optimize so much as lea...
After sitting through a session today on Mono at a local .Net event, the use of MonoTouch was 'touched' upon as an alternative for iPhone development. Being very comfortable in C# and .Net, it seems like an appealing option, despite some of the quirkiness of the Mono stack. However, since MonoTouch costs $400, I'm somewhat torn on if t...
My table view cells have the ContentView as the Labels. When i click on them to navigate to another view whose viewController is as shown does not navigate.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DetailedWebViewController *detailedWebViewTab1=[[DetailedWebViewController alloc] ...
I have a class and I want to setup what is printed when I call NSLog with that class. For example,
NSLog(@"%@",nonstandardObject);
How do I setup the object so it prints out what I'd want?
...
I'm in the midst of debugging an extremely unusual problem, and I was wondering if anybody might have any insight into what might be going wrong:
In a controller class from a NIB, I take an NSPanel from that same NIB, and then show it app modally on an NSWindow (that was created by hand in code):
[[NSApplication sharedApplication] begi...
Let's say I have a method with this signature:
-(void)plotPoly:(Polygon *)poly WithColor:(UIColor *)color AndFill:(BOOL)filled;
How do I get that UIColor and BOOL in there as well as the Polygon?
Should I wrap them in a NSArray and pull them out inside the called method? That would mean I have to change the method sig, right?
Is th...
Is there any primitive data type that it's safe to not initialize?
How about structs like CGPoints or NSRects?
...
I thought it would be simpler to find if an object in on a dictionary, but it appears it is not.
I have a NSMutableDictionary with just one key named "products".
I have several products added to the dictionary dynamically, using something like
[myDict addObject:@"banana" forKey:@"products"];
[myDict addObject:@"orange" forKey:@"produc...
hi,
i am parsing two xml files with one xml parser class , i have a table view where the data is displaying after parsing .. here is a imageview and label , when i parse the first xml like if i parse myxml_1.xml and then display data in a table view its fine . but when i parse again the xml named myxml_2.xml and display the data in that...
I'll preface my question by saying that I'm a beginner objective-c developer. What is the difference between:
NSString * foo;
NSString* foo;
NSString *foo;
Is there a difference?
...
I am not sure if something has changed in the iPhone SDK 3.0 but I am getting the strangest error. I have a view controller hierarchy where I switch between view controllers depending upon interface orientation. From what I can tell, the error is caused whenever I rotate the interface a view controller which has been deallocated is being...
I have a novice question, will be happy if any one out there can help me.
I have an NSMutableArray, for example:
{
JobID = 109302930;
Subject = "Test Subject";
SubmitDate = "2009-09-15 17:27:34";
}
I am now trying to create sections in my table view and want to group my records based on "formatted" SubmitDate. For example;
16th May'...
In my iPhone app, I have two plist files to store "Themes". One is a read-only file containing default themes, and one contains custom Themes that the user has created. I'm using plist files because it's very easy for me to read from the plist and create new Theme objects.
My plist is an array of dictionary objects.
Is there any easy w...
Hi,
This code:
MPMediaQuery *query = [MPMediaQuery artistsQuery];
NSArray *songsByArtist = [query collections];
for( MPMediaItemCollection *c in songsByArtist ) {
NSLog(@"artist %@ has %u songs",[[c representativeItem] valueForProperty:MPMediaItemPropertyArtist], [[c items]count]);
}
works as expected. But this code:
MPMediaQuery ...
My table view cells have the ContentView as the Labels. When i click on them to navigate to another view whose viewController is as shown does not navigate.
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DetailedWebViewController *detailedWebViewTab1=[[DetailedWebViewController alloc] initW...
Just as a matter of curiosity, how does the nextResponder method implementation of the UIView class know who is the UIViewController that manages the view?
The UIResponder documentation states this, and I can see it work, but I don't quite understand it. To the best of my knowledge, a UIView does not maintain a reference to it's controll...
Hi,
I use ccTouchesBegan and ccTouchesEnded to draw a line. I want to draw a line when i drag the cursor(or finger) on screen. That mean, when i release the cursor, it will draw a line with the first point is the position which i has a first touch (ccTouchesBegan) and last point which i have when release (ccTouchesEnded). Here is my code...
im beginning in Objective-C development and as i can see in the development blogs(about Objective-C) like w3schools.com we dont have such type of sutes to learn Objective-c language , can any one known the such type of Sites to Learn objective-c language .. please let me know--
...
Hi
I've subclassed UITableView (as KRTableView) and implemented the four touch-based methods (touchesBegan, touchesEnded, touchesMoved, and touchesCancelled) so that I can detect when a touch-based event is being handled on a UITableView. Essentially what I need to detect is when the UITableView is scrolling up or down.
However, subcl...