I have seen some questions/answers regarding filter objects by using NSSet/NSMutableSet. Those cases use simple type of objects such as NSString or int. The following is an example of codes used to filter NSString objects:
NSSet smallArray = [[NSSet alloc] initWithObjects:@"0", @"1", @"2", nil];
NSArray bigArray = [[NSArray alloc] initW...
This is a little side project I'm working on for fun.
I begin by initializing with
- (void)viewDidLoad {
[super viewDidLoad];
rootArray = [[NSMutableArray alloc] initWithObjects:@"Earth",@"Mars",@"Pluto",nil];
moonArray = [[NSMutableArray alloc] initWithObjects:@"Clavius",@"Galileo",@"Ptolamy",nil];
marsArray = [[NSMutableArray al...
In my .m file for a class named Ad , I have 3 static strings
static NSSTring *AdStateDisabled = @"disable";
static NSSTring *AdStateExpired = @"expired";
static NSSTring *AdStateActive = @"active";
I can simply use these static variables in the current class, but i cannot call them from any other class, is there a way to make these st...
Hi, i'm have problem with the writing TCP socket in objective c. i'm having the following error when i then to write a string to my server. some help please?
error writing to stream <__NSCFOutputStream: 0x102009f0>: Error Domain=NSPOSIXErrorDomain Code=9 "
the following are my code. Thanks inn advance
- (void)setup {
host = // ...
I'm trying to replicate the unrar functionality in this project:
http://github.com/tarasis/QuietUnrar
But having trouble. I have copied the relevant files (/libunrar/,QuietUnrarAppDelegate.) into my project so I can turn QuietUnrarAppDelegate into a more generalised Unrar class, and immediately I run into problems. All the source files...
i have pickerview with 2 components.when i select an item from both components some textfield and label should be displayed.this should happen for every combination.can anyone provide me the solution to this..actually im new to objective c
thanks..
...
Hi there,
In my iPhone App I have the capability to export data to an .txt file and send it via Mail – but have currently problems regarding the encoding.
To attach the file to mail I simply create a NSData instance from a NSString instance as followed:
NSData *dataToExport = [[NSData alloc] initWithData:[myExportString dataUsingEncod...
I'm trying to write a simple application that gathers the RSSIValue and displays it via NSLog, my code is as follows:
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h>
#import <IOBluetooth/objc/IOBluetoothDevice.h>
#import <IOBluetooth/objc/IOBluetoothHostController.h>
#imp...
Hi,
I'm relatively new to iPhone dev and have been trying to build an application to understand how CoreData works.
I'm trying to implement some functionality that will allow me to detect if anything has been persisted to store and if so - give the user the option to delete those objects.
I wondered if there are timing issues that nee...
Guys:
Please help. I have a utility class to return a NSString with encoding. Like this:
/*Get a NSString with chinese encoding*/
+(NSString*) getGBKString:(void *)buffer
{
NSString* string = [[[NSString alloc]
initWithBytes:buffer
length:sizeof(buffer)
encodin...
Hi,
Here is an example taken from Apple iPhone SDK project:
@interface EADSessionController : NSObject <EAAccessoryDelegate, NSStreamDelegate> {
EAAccessory *_accessory;
EASession *_session;
NSString *_protocolString;
NSMutableData *_writeData;
NSMutableData *_readData;
}
...
// initialize the accessory with the ...
I need to imlement in cocoa, a design that relies on multiple threads.
I started at the CoreFoundation level - I created a CFMessagePort and attached it to the CFRunLoop, but it was very inconvenient as (unlike on other platforms) it needs to have a (systemwide) unique name, and CFMessagePortSendRequest does not process callbacks back t...
When I receive data from web service my NSMutableData is filled with following XML:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetWeatherResponse xmln...
I have a CoreData relationship set up as follows:
(sorry, I'm new to stackoverflow so I have to draw it with ascii).
Story (object)
Attributes:
creationDate,
order,
Relationships:
sentences (one to many with Sentence)
Sentence (object)
Attributes: image, order, text
Relationships: belongsTo (one to one with Story)
Notes:
t...
Hi, I have an animation (currently 30 different images repeating) and I wish to add it into a single page in a ScrollView (currently holding 7 pages). Can this be done?
I've added my code below, the behaviour I'm getting is that on my selected page nothing appears, on all the other pages I get the images as normal, but there must be som...
i have been struggling with this for a few days, i even re-wrote half the code to try it another way.
i have my annotations imported from a csv, and placed onto the map with tile and subtitle, i am trying in vain to add a tag to disclosue buttons so i can see which one was tapped, but having problems, whatever values i assign to the an...
Hi all
I'm afraid I'm a newbie to objective-c programming, and I am having a problem that I have spent all day trying to figure out and I cannot, so I am humbly asking you guys if anyone can help.
I am trying to read the details from a JSON page online (for instance a local services directory) and have installed the JSON library into X...
I am trying to rotate UITextField at 90 angle.It is rotationg perfectly..but text inside the UITextField, is displaced.I am unable to find out the reason behind it.
...
I want update position of Particles for store this information I use NSMutableArray. I want do update 1 time per 2 seconds for example. For this I try use this code.
//ParticlesLayer.h
@interface ParticlesLayer : CCLayer {
CCQuadParticleSystem *particle;
NSMutableArray *partilesCoordinates;
}
@property (assign, readwrite) NSMutableArra...
Hi,
I have read about a number of posts for developers who want to plot out a route on a map on an iPhone but there is no satisfactory answer as how to best achieve this. You can use the Route-Me library, add a layer on top MKMapView or send coordinates to phones map software then you navigate from your application, which in my opinion i...