I would like to get at
- (void)applicationWillTerminate:(UIApplication *)application
a variable from a view controller class.
I have build an tabbar application and only added the tabbar controller to the appdelegate.
[window addSubview:tabBarController.view];
How can i get an variable from the TestViewController:
#import <UIKit/...
Hi
I am a relatively new iPhone app developer so my knowledge is a little sketchy, so please forgive me if this is a bit of a trivial question.
I have a navigation app which drills between table views by calling pushViewController on the navigationController object
I have one particular section which pushes new view controllers sequen...
Hi!
It might be that the problem is straight forward but I don't get my head around it.
I have the following iPhone code
for(int x = 0 ; x < [allFriends count] ; x++)
{
Friend *f = [[Friend alloc] init];
f = [allFriends objectAtIndex:x];
if([uid isEqualToString:[f uid]])
{ ...
I am just grasping the concepts of TDD and mocking, and am running into an issue in terms of how to properly. I have a sheet that drops down and lets a user create a new core data object and save it to the data store. I am not sure if I am taking the best approach to testing it.
- (IBAction)add:(id)sender
{
NSString *itemName = [...
Hi,
The challenge:
i'd like to do some action if the user touches a TableItem.
The problem: The didSelectRowAtIndexPath method is never called? Did i miss sth?
PortfolioViewController.h
@interface PortfolioViewController : TTTableViewController <TTTableViewDelegate>
{
}
@end
PortfolioViewController.m
@implementation Portfoli...
I am new to iPhone development. I am displaying in a group tableview contents parsed from XML.I want to disable the click event on it (I should not be able to click it at all.) The table contains two groups. I want to disable selection for the first group only but not the second group. Clicking the first row of second group navigates to ...
Im reading the address book contacts... everything goes well until I test a contact with no
First Name ( Since I can create a contact with just an email or a phone or wathever....).
The code (reduced) is this:
- (NSMutableArray *) getContactsInfo {
NSMutableArray *contactsList = [[NSMutableArray alloc] init];
localAddressBook =...
Look at the following method:
-(void)updateProfile:(Profile *)profile WithJSON:(NSString *)JSON;
{
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *object = [parser objectWithString:JSON error:nil];
NSNumberFormatter *nf = [[NSNumberFormatter alloc] init];
[nf setPositiveFormat:@"#,##0"];
profile.displayName =...
I must be stuck on stoopid today because I spent over an hour trying to understand how to make variable args work in this iPhone project I'm working on. Could somebody help me get a green bar in the below unit test? Where am I going wrong?
#import <SenTestingKit/SenTestingKit.h>
@interface VAArgsTest : SenTestCase
{
}
@end
NSString*...
Hi,
I have an NSArray of NSDictionaries. I need to check if there's at least one occurrence of an object for a key of the NSDictionary in the NSArray. I do this by using
int i;
for (i=0;i< [myArray count];i++)
{
if ([[[myArray objectAtIndex: i] objectForKey: myKey] isEqualToString: myString]) {
found = YES;
break;
...
Possible Duplicate:
How to Think in OO
I am sort of new to programming. I am working with Objective-C and iPhone app Dev. I am having some trouble wrapping my mind around the OOP mindset. Does anyone have any tips or tricks to think or visualize the programming process before you sit down and start it?
...
Please help with this issue of using NSFetchedResultsController.
I created an object of NSFetchedResultsController and I use it once in the method: tableView:cellForRowAtIndexPath: and when I try to execute the same code in the method tableView:didSelectRowAtIndexPath: I get EXC_BAD_ACCESS.
Here is the code of the 2 methods
- (UITable...
I run into design choices like this often and struggle a bit; I'm looking for some other perspectives.
I often want to keep lists of, or pass around chunks of state that are basically just sets of values. The values tend to be primitive types: floats, NSTimeIntervals, CGPoints, etc.
My first inclination is often to create C structures ...
I'm in the middle of writing some Cocoa classes to parse ID3 tags from MP3 files. To make them as easy to use as possible, I'm allowing the option to request a tag by the actual ID3 frame id ("TCON", "TPE1", "TALB", etc.) or an equivalent word/phrase ("genre", "artist", "album", etc.)
To store this data, currently I have a reference cla...
In Interface Builder.app (and some other cocoa apps), image dragging has a very nice/sexy effect of morphing the drag image while you drag a draggable item out of its window.
For example in Interface Buildler.app:
Show the Library Palette (⇧⌘L, or Tools Menu -> Library)
Drag an item out of the Library palette
NOTE: as you drag the ...
I have a simple UIViewController and a UISearchBar, when the view loads I want to have the search bar become the first responder right away so that the keyboard is showing and they can start typing their query right away. I tried doing it in viewWillAppear like below without any luck:
- (void)viewWillAppear:(BOOL)animated
{
[product...
Hi all, I have some code which fetches an XML file from a URL and then parses it using NSXMLParser. Currently this code is contained within the viewController which calls it. I would like, for re-usability sake, to move the parsing code to an external class and call it from the viewController.
I tried to achieve this as follows:
Crea...
I've looked all over the web but just can't figure out how to get the text from a node in objective-c. I'm using touchxml and am getting my node list but U I want the title text from a node but instead get a node object. My code is:
resultNodes = [xmlParser nodesForXPath:@"SearchResults/SearchResult" error:&err];
for (CXMLElement *resu...
I'm trying to come up with a way to make it easy to switch out our "mock" data services and our live ones. Basically, we'll have live servers with real web services, but for whatever reason, a developer may want to load data from static files (file urls).
I figured I would solve this problem by creating categories that override the met...
The third-party library generates sequential buffers of 16-bit signed stereo samples of any desired size. I can't figure out which framework/functions to use to play from these buffers. I've been working off the example in this answer using AudioQueue but it's obviously incomplete in ways I can't resolve (local variables are used as if t...