I'm building a program, and I'm quite confident using Objective-C, but I don't know how to programmatically download a file from the web and copy it on the hard drive.
I started with :
NSString url = @"http://spiritofpolo.com/images/logo.png";
NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
But then I don't kn...
I want to push a landscape view from within a uinaviagtioncontroller, whose initial view is in portrait...
So you click a button, or tableviewcell, and the screen rotates 90° into the new view..
How would I manage that? This is similar to how the Youtube app works when transitioning from movie info screen to the actual movie.
(note: i ...
I am doing a comparison in
- (CGFloat)tableView:(UITableView *)tblView heightForRowAtIndexPath:(NSIndexPath *)indexPath
It seems like performance of my app really slows down when I check if a cell.detailTextLabel.text isEqualTo:@"None";
What is a better way of doing the comparison and setting the cell height?
...
Hello,
I'm attempting to load data from an undocumented API (OsiriX).
Getting the NSManagedObject like this:
NSManagedObject *itemStudy = [[BrowserController databaseOutline] itemAtRow: [[BrowserController databaseOutline] selectedRow]];
works just fine.
But getting the NSManagedObject like this:
seriesArray = [_context executeFetchR...
In objective C, I'm trying to make something hide from view.
Could anyone tell me how to do it by using some sort of
-(void) something {?
It's a variable, and I need to make it only appear when a certain variable is true. I want to know how to make that variable turn invisible all the time to start it off.
...
To conserve space, we are attempting to split a pvr animation which is 512 pixels square into several smaller windows, or 2x256sq + 8x64sq along the bottom.
This will mean that not as much space is wasted by views being off the screen, and therefore will take up less space to download.
For an initial test, we're doing 4x256 to keep t...
I have create a class MyConnection that extends NSURLConnection. I have implemented some delegate methods. I am able to print the data received from the URL call. However when I pass the MyConnection instance into MyHelper class, I do not get the data received in the MyConnection class. I tried putting a sleep call between the two task a...
I need help creating an object for this declare
UIWebView *webView;
I thought it was the object, but Its the declare in my header file. Can someone help me create the object for this declare?
...
I don't understand the concept of delegation is used in XCode. When a new project is created, an app delegate and a view controller are created, but what does the app delegate do? How does main.m know to call the delegate?
...
Is it possible to use the class methods of some NSObject I've made to controls all existing instances?
I want a delegate class to be able to send messages to the Object's class methods which can then react appropriately with everything out there.
...
I have a UITableView that is re-using cells when the user scrolls. Everything appears and scrolls fine, except when the user clicks on an actual row, the highlighted cell displays some text from another cell. I'm not exactly sure why.
#define IMAGE_TAG 1111
#define LOGIN_TAG 2222
#define FULL_NAME_TAG 3333
// Customize the appearance o...
In c# I can declare object o; then I can assign o=(float)5.0; or o="a string." Is there an equivalent for Objective-C? I tried to use id but it does not take primitive type like float or integer. Thanks for helping.
...
Another iPhone noob question.
The app I'm building needs to show a shared custom UIToolbar for multiple views (and their subviews) within a UITabBarController framework. The contents of the custom toolbar are the same across all the views. I'd like to be able to design the custom toolbar as a xib and handle UI events from its own cont...
I got this code:
GrooveOnDownload *dlg = [[GrooveOnDownload alloc] init];
NSURLDownload *dw = [[NSURLDownload alloc] initWithRequest:request delegate:dlg];
It starts the download in a delegate class with outlets for UI controls. But for some reason controls don't respond to direct messages from the delegate.
//Header of the delegate...
I'm trying to use the MPMediaPlayback protocol's currentPlaybackRate() to slow down a video. I'm confused though as the class MPMoviePlayerController states that:
You can control most aspects of playback programmatically using the methods and properties of the MPMediaPlayback protocol, to which this class conforms.
Except just abo...
I have the following two class:
//file FruitTree.h
@interface FruitTree : NSObject
{
Fruit * f;
Leaf * l;
}
@end
//file FruitTree.m
@implementation FruitTree
//here I get the number of seeds from the object f
@end
//file Fruit
@interface Fruit : NSObject
{
int seeds;
}
-(int) countfruitseeds;
@end
My question is at th...
I'm very new to core audio and I just would like some help in coding up a little volume meter for whatever's being outputted through headphones or built-in speaker, like a dB meter. I have the following code, and have been trying to go through the apple source project "SpeakHere", but it's a nightmare trying to go through all that, witho...
This is supposed to decrypt a hex string with an ascii string, using rc4 decryption. I'm converting my java application to objective-c. The output keeps changing, every time i run it.
#import "RC4.h"
@implementation RC4
@synthesize txtLyrics;
@synthesize sbox;
@synthesize mykey;
- (IBAction) clicked: (id) sender
{
NSData *asciidata1 ...
How to make a Cocoa applicaion quit when the main window is closed? Without that you have to click on the app icon and click quit in the menu.
...
I'm trying to recognize the result of a generic query to a managed object as an NSSet. Currently the class returned is a member of _NSFaultingMutableSet, which is clearly related, but fails the isMemberOf:[NSSet class] and isKindOf:[NSSet class] calls.
Given that Cocoa doesn't do a direct implementation of NSSet, it's not surprising th...