I'm going through a tutorial on drawing a custom [shaped] window with cocoa by subclassing NSWindow.
The tutorial states that in initializer developer should do the following:
[self setOpaque:NO];
[self setBackgroundColor:[NSColor clearColor]];
So i'm wondering what is the differnce between these two messages and why are they needed ...
Hi, why can't I get my programmatically created UIScrollView (or plain UIViews) to sit where I want them?
I am building a viewcontroller component that builds up a uiscrollview and adds it as a subview to placeholder UIView that was dropped in the design using IB.
the main view, with UIView IBOutlet 'ibView' linked to the placeholder v...
I've just finished off an app for the iPhone which, until today, ran fine on the iPhone simulator and actual devices.
I tried changing the xib which is loaded in the applicationDidFinishLaunching method in my application delegate class - all I did was change the string in initWithNibName.
When I launch the app on the simulator, the De...
I'm trying to programmatically create a window with custom contentView and one custom NSTextField control, but i'm having trouble getting this hierarchy of window and views to draw themselves.
I create a custom borderless window and override it's setContentView / contentView accessors. This seems to work fine and custom contentView's in...
is it possble to show map in lanscape mode?
...
How would I use NSRunningApplication? I have something opposite of that which is launching an app:
[[NSWorkspace sharedWorkspace] launchApplication:appName];
but I want to close one. I get an error when I debug the code for NSRunningApp which is this:
NSRunningApplication *selectedApp = appName;
[selectedApp terminate];
Is there so...
i want to create a path.something like i touch the screen and draw line in touchmove event.when line intersect from starting point.fill that path using any colour.
now see in the image i've drawn a line.i just want to detect if line intersects again to start point.then fill that path with my own desired color.also i m using core graph...
I feel embarrassed asking this, but it seems like something I need to understand:
Why does this evaluate to true? (if I cast it to int it properly evaluates to false)
NSString *var1 = @"ABC";
NSString *var2 = @"ABCD";
if (([var1 length] - [var2 length]) > 2) NSLog(@"-1 > 2");
...
Hi,
Is there any IoC container for Objective-C?
...
Right now I have my application executing some things using AuthorizationExecuteWithPrivileges. The problem is that it needs to ask for the password for every operation. Is there any way I could have it authenticate as soon as the app starts so that it won't ask for authorization later, and then release the authorization object when its ...
Hello community!
I am trying to solve a basic problem with drag and drop on iPhone. Here's my setup:
I have a UIScrollView which has one large content subview (I'm able to scroll and zoom it)
Content subview has several small tiles as subviews that should be dragged around inside it.
My UIScrollView subclass has this method:
- (UIV...
In Objective C, is there a way to determine at runtime, if an object is retained, which other object might be retaining that object?
Or to phrase it a little differently:
If there are leashes on the dog is it possible to know who is holding the leash?
Assume you have this hypothetical scenario:
MyObjectOne
and
MyObjectTwo
inside ...
In a navigation based app, I initialize an array in my app delegate without using self. When accessed in the RootViewController's cellForRowAtIndexPath:, all array objects are there and I can see it is an NSCFArray. Once the app loads, I click a table cell and in didSelectRowAtIndexPath:, that same array has a type of NSArray, no object...
I would like to declare a pointer to a pointer in objective-c.
I have an instance variable (primaryConnection) that should be updated dynamically to point to a local variable when it changes.
NSURLConnection *primaryConnection;
-(void) doSomething
{
NSURLConnection *conn;
primaryConnection = conn;
conn = // set by something els...
I'm working on an iPhone app (first real programming project) and I had two views that would go into tabs in separate applications to build them, where they work fine. Then I added them back into the main project; The tableviews bring on a crash with an numberOfRowsInSection] unrecognized selector sent to instance 0xXXXXXX so I isolated ...
Is there a way to test in viewWillDisappear if it's being called because the application is exiting, versus normal ways of it being dismissed? The method applicationWillTerminate in the App Delegate is called after the current view is closed. I want to do different things depending on whether it's being dismissed due to a IBAction or t...
I have a typical RSS style application . I want to delete all the stories which are more than X days old, So that i dont keep filling up users HardDisk with old stories .
Now, I am wondering what the best time and place for doing such clean up would be ?
Is applicationWillTerminate in the app delegate right place to do it ? Also I thin...
Hi,
In the following bit of code, I'm setting the table view cell text with a value from the NSMutableArray 'categories' which is a property of my view controller. That works fine.
But when I try the exact same code in another method, it crashes (it compiles without errors or warnings). If I change the following line in the didSelect...
I am developing an iphone application in objective c.
I have to get the list of the states of USA programatically. How can I get that list?
...
According to another Stack Overflow post the drain message is an Apple-only call:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Hello");
[pool drain];
return 0;
Is it safe to replace drain with release? I am trying to port an Objective-C application to run on Linux (Ubuntu at the moment). Should I give up even b...