objective-c

noob iPhone "count" frustrations!?!?!

Okay, I know I must be doing something incredibly stupid here. Here's the sample code (which, when executed within a viewDidLoad block silently crashes... no error output to debug console). NSMutableArray *bs = [NSMutableArray arrayWithCapacity:10]; [bs addObject:[NSNumber numberWithInteger: 2]]; NSLog(@"%@", [bs count]); [bs release];...

An NSMenuItem's view (instance of an NSView subclass) isn't highlighting on hover

I need to use a custom NSView subclass to draw some content, but it isn't drawing as highlighted when the user hovers and it doesn't dismiss the NSMenu when the user clicks on it. Any ideas? Edit So using -drawRect: and [[self enclosingMenuItem] isHighlighted] I'm able to tell whether or not I need to draw the view as highlighted and a...

Mac OS : creating a background periodic simple script

Hi folks ! I have a friend who wants something quite easy : he has a mac, and he would like a very simple script/app that runs in the background. The goal is to replace a file every 5 minutes with one downloaded from the internet. I would also like a menu on the top bar (like the clock on Mac Os, the wifi, the sound, Dropbox,...) What wo...

Easiest way to get an NSDate representation of "the next 7am that will occur" in Cocoa?

I figure I can achieve what I want by using NSCalendar and NSDateComponents, but that would run something like the following: Get "now" Create an NSDateComponents from "now". If "now" is pre-7am, then use today's date. If "now" is post-7am, use tomorrow's date. If today is the last day of the month, increase month, set day to 1. If i...

Issue involving application internationalization on iPhone SDK

Hello there, I'm creating an application which there's a way to the user change its language on the Settings.app (so I'm using the Settings.bundle file), it's working great. But when I change the language and open the application again, it changes the key AppleLanguages with the selected language, but no changes to the "interface" (noth...

iphone sdk textbox

I'm learning programming iphone app. i need some help making a scrollable textbox with a image background. like the ipod music player with lyrics. thx ...

Getting rid of full-path filenames in obj-c binaries

Running "strings" on a (non-debug) iPhone app binary reveals a bunch of filenames of my source files... These are full paths and so reveal my username, which I'd rather keep private. I understand these strings are there for some Obj-C magic that I don't currently need, what I'm hoping is that there's a compiler switch I can flip that wi...

NSInteger differences between CLI and GUI ?

I've been building a framework and writing unit tests in GHUnit. One of my Framework's accessor methods returns an NSInteger. I assert the expected value in the tests like this: GHAssertEquals(1320, request.port, @"Port number should be 1320"); When running my tests with an AppKit UI based frontend this assertion passes. However, w...

Is this a UITableView? How does this work?

Click the header section(or whatever it calls) will unfold the relative subcells,and the left triangle get rotated. I have no idea how to code this.Is there anyone help me? Any code snippets would be great help.Thanks a lot. ...

UITableView smooth scrolling performance

What makes scrolling so choppy on the UITableView when images are loaded? Is it because they need to be added as subviews? Or is it because images need to be cached? Both? ...

dismissPopUp is not recognized

Assuming button1 is an NSPopUpButton Assuming menu attached to button1 is displayed and being tracked. [[button1 cell] dismissPopUp] --- dismissPopUp is not recognized. Why is the dismissPopUp method not recognized? Thanks ...

custom UIButton with skewed area in iPhone

I want to have a button on a screen with this image. this image is transparent from its corners as you can see here. UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom]; [btn setFrame:CGRectMake(xCo, yCo, kImageSizeWidth, kImageSizeHeight)]; [btn setImage:[UIImage imageNamed:@"aboveImg.png"] forState:UIControlStateNormal]; [btn...

How can I call Objective-C code (specifically code from Mac system libraries) from C++/Qt?

Also, what is the difference between a .m and a .mm file? Or is that just some convention that Nokia uses for Qt? ...

Ipad - Display thumbnail from video

Hi, I have a video store in my bundle, how can I display a thumbnail of it with the new Media Player Framework from the Ipad (thumbnail + the white play button on it), I can also store my video online it will be better. Someone have an idea? best Regards, ...

iPhone development

Hi All, I am new to iPhone development. I want to make a simple iPhone application which when launched computes the distance travelled by the user,calories burnt,postion of the user,movement.Can anybody provide me the details or approach to follow to develop this application. ...

Mac OS X linker error in Qt; CoreGraphics & CGWindowListCreate

Here is my .mm file #include "windowmanagerutils.h" #ifdef Q_OS_MAC #import </System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGWindow.h> QRect WindowManagerUtils::getWindowRect(WId windowId) { CFArrayRef windows = CGWindowListCreate(kCGWindowListOptionOnScreenOnly, kCGNullWindowID...

default value of BOOL in Objective-C?

Hello , What is the default value of BOOL in Objective-C? ...

UIView animation cancels previous animation?

Hi I have an NSTIMER that counts the time, and on t = 10, it fires an animation but during that time it might happen that another animation is running. This causes the previously running animation to cut off. Any idea? i thought UIVIEW animations were ran in diff threads. I cannot use a willstop selector here since t = 10 might happen wh...

Subclassing UIButton but can't access my properties

Hi, I've created a sub class of UIButton: // // DetailButton.h #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface MyDetailButton : UIButton { NSObject *annotation; } @property (nonatomic, retain) NSObject *annotation; @end // // DetailButton.m // #import "MyDetailButton.h" @implementation MyDetailButto...

Objective-c design advice for use of different data sources, swapping between test and live

I'm in the process of designing an application that is part of a larger piece of work, depending on other people to build an API that the app can make use of to retrieve data. While I was thinking about how to setup this project and design the architecture around it, something occurred to me, and I'm sure many people have been in simila...