I am trying to open a NSWindow using the following code:
NSWindowController *window = [[NSWindowController alloc] initWithWindowNibName:@"MainWindow"];
[window showWindow:nil];
The window opens okay but the previous window is still the mainWindow and in focus. I have tried the following code to force the main window and it doesn't wo...
I'm trying to set up a UITableView which acts as a form. Each cell has within it a UILabel and a UITextField, so one cell is:
Name <enter name>
^ ^
UILabel UITextField
Now, I'm trying to populate the UILabel and the UITextField from a NSDictionary (from a plist), where it's organized like so:
Root ...
Hi all,
How can you convert the UNIX timestamp (that is in the form of a number denoting timestamp) into date, time(hours, minutes, seconds) in Objective-C?
Thanx in advance.
...
I am using two UIAction sheets within my current project. I can get one to work perfectly fine but when i insert a second action sheet it runs the same arguements as the first. How do i define the actionsheets seperatly?
-(IBAction) phoneButtonClicked:(id)sender
{
// open a dialog with just an OK button
UIActionSheet *actionShee...
I am confused about what the difference is between a protocol and an interface? They both seem to be doing the same thing?
Is it like abstract in C# in that you are required to implement it?
...
In my .h file I have:
NSMutableArray *myArray;
@property (nonatomic, retain) NSMutableArray *myArray;
My .m file looks basically like this:
@synthesize myArray;
- (id) init {
self = [super init];
if (self != nil)
{
self.myArray = .... ? // here I want to create an empty array
}
return self;
}
- (void) ...
Continued from the last question here: Log method name in Obj-C . I just wondered if there is a way to print out the variable name as well. For example:
NSString *name = "vodkhang";
NCLog(@"%@", name);
and I hope that the output should be:
name: vodkhang
Just to summarize the previous post, currently, I can print out the class name...
Hi,
I'm using two UIViewController in Application Delegate and navigating to UIViewController using presentmodalviewcontroller. But Problem is that presentmodalviewcontroller works for first time UIViewController and when i want to navigate to second UIViewController using presentmodalviewcontroller then its showing first UIViewControlle...
hello,
Can we change the color of the table view title the string which i am showing appears in gray color can we choose color for it .Is there any property of table view title
i am not asking for table view header or footer i mean the title
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)sectio...
This is an agonizingly rookie question, but here I am learning a new language and framework, and I'm trying to answer the question "What is Truth?" as pertains to Obj-C.
I'm trying to lazy-load images across the network. I have a data class called Event that has properties including:
@property (nonatomic, retain) UIImage image;
@proper...
Are the parent classes always referenced by the inferface not the implementation?
@interface MyClass : ParentClass
@end
@implementation MyClass
@end
...
Hi,
I use a UITabBarController with 4 views. The first of those 4 views should be able to rotate, the other three not. And now the problem is, when having a tab bar controller you have to set all used views to rotatable (i.e. returning TRUE in shouldAutorotateToInterfaceOrientation).
So, my question is now, can I prevent the three vie...
I am really puzzeled by this one. I have set up two UIActionSheets in my application. They work perfectly fine until you use the cancel button in the UIActionSheets.
When i navigate away from the page the UIAactionSheet returns too it crashes my app.
Does anyone have any ideas as too why?
-(IBAction) phoneButtonClicked:(id)sender
{
/...
Hello.
I've been developing for Visual Studio and C# for a long time. Now, I'm developing with XCode and Objective-C.
On C# I can use /// <summary> to generate documentation. Is there any kind of mechanism like that on XCode to generate documentation? And what kind of comments should I use?
Thank you.
...
this is my code:
CLLocationCoordinate2D location1;
for(int i=0;i<[appDelegate.books count];i++)
{
Book *aBook= [appDelegate.books objectAtIndex:i];
NSLog(@"Reading id value :%f",aBook.Latitude);
location1.latitude=aBook.Latitude;
location1.longitude=aBook.Longitude;
addAnnotation = [[AddressAnnotation...
Hi,
I am developing for iphone. I want to creating a mutable path via CGPathCreateMutable(), and I want to return it out of the function which creates it. I'm suppose to call a CGPathRelease() when I'm done with it. But since I'm returning it I wish to autorelease it. Since Quartz path is a C code (and doesn't look like an objective C o...
I have a class that makes multiple asynchronous connections where each connection performs its own logic in the delegate methods.
Because the delegate is the class itself, how can I implement this separation in logic in the NSURLConnection delegate methods?
...
Hello:
I am using a UIScrollView to forward touches to Cocos2D as outlined in http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/
Everything works great after a few days of working with it, except one thing: when the initial view appears on the screen, the background appears to be scrolled to the center. As soon as I try to s...
When I have conflicting definitions of the ivars of a class in objective-c (not redeclaring the class in the same file, but rather naming the same class with diff ivars, no warnings or better yet errors are issued by the compiler. However, both sets of ivars are useable by the appropriate methods in the respective files. For instance
...
I have noted several other threads on this topic and have tried wrapping my threaded code with:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
[pool release];
but the errors still come.
I am using a static method to instantiate a dictionary of words.
Here is some code:
-(id)init
[NSThread detachNewThreadSelector...