Re: Enable Unique Selection

2013-05-04 Thread Andy Lee
On May 4, 2013, at 12:54 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:
 Seems to me rather less code.

Well sure, if you want to write *less* code. :)

(To add to the duh factor, I know I wrote other value transformers on that 
project.)

--Andy


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSInputStream get NSStreamEventEndEncountered without reason

2013-05-04 Thread Kévin Vavelin
I use SocketIO project on my iOS app to connect to my node.js server and 
everything works great until I choose to connect to facebook. When I connect to 
Facebook I send some data to my server and he answer with some data like user 
already connected, user created in database etc. And after that, my 
NSInputStream seems to be at 0 and so my connexion is closed. I don't know what 
to do, I spent 14 hours on that and still get this issue...

Can you help me with ?
Looks like the problem is in SRWebSocket.m line 1462

There is the code in fault :

case NSStreamEventEndEncountered: {
[self _pumpScanner];
SRFastLog(@NSStreamEventEndEncountered %@, aStream);
if (aStream.streamError) {
[self _failWithError:aStream.streamError];
} else {
if (self.readyState != SR_CLOSED) {
self.readyState = SR_CLOSED;
_selfRetain = nil;
}

if (!_sentClose  !_failed) {
_sentClose = YES;
// If we get closed in this state it's probably not 
clean because we should be sending this when we send messages
[self _performDelegateBlock:^{
if ([self.delegate 
respondsToSelector:@selector(webSocket:didCloseWithCode:reason:wasClean:)]) {
[self.delegate webSocket:self 
didCloseWithCode:0 reason:@Stream end encountered wasClean:NO];
}
}];
}
}

break;
}

case NSStreamEventHasBytesAvailable: {
SRFastLog(@NSStreamEventHasBytesAvailable %@, aStream);
const int bufferSize = 2048;
uint8_t buffer[bufferSize];

while (_inputStream.hasBytesAvailable) {

int bytes_read = [_inputStream read:buffer 
maxLength:bufferSize];

if (bytes_read  0) {
[_readBuffer appendBytes:buffer length:bytes_read];
} else if (bytes_read  0) {
[self _failWithError:_inputStream.streamError];
}

if (bytes_read != bufferSize) {
break;
}
};
[self _pumpScanner];
break;
}

And the result from my server (initalLogin = yes connexion is good you can 
continue) :

onData 
5:::{name:initalLogin,args:[{guid:af78bdf0-f17d-ede2-7dd6-22708d1330f7,usedWithFaceBook:true}]}

start/reset timeout
NSStreamEventEndEncountered __NSCFInputStream: 0xab21660
onDisconnect ()

DECONNEXION = The operation couldn’t be completed. (SocketIOError error -4.)

Can you help me with ?

Thanks in advance.

Vavelin Kévin
Twitter | Blog | LinkedIn 
Entrepreneur
Developer OS X / iOS

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

What am I looking for in the documentation?

2013-05-04 Thread YT
I have need to turn a local float value into a char array. 

That is, The Quartz 2D graphics function requires the passing of a (const char 
*) to a text string or I was thinking of a character array.

My mind is mush at the moment - can't seem to recall the way to program a 
conversion of 

float fv = 40.0; 

into

const char *text = 40.0;

or 

const char text[ ] = 40.0;


Please advise...

Thanks YT



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What am I looking for in the documentation?

2013-05-04 Thread Rick Mann
You need to do a string conversion, just like you would in any situation where 
you need a textual version of a number.

One possible way:

NSString* s = [NSString stringWithFormat: @%.1f, fv];
const char* sp = s.UTF8String;

another:

char* s[16];
snprintf(s, 16, %.1f, fv);



On May 4, 2013, at 16:20 , YT y...@redwoodcontent.com wrote:

 I have need to turn a local float value into a char array. 
 
 That is, The Quartz 2D graphics function requires the passing of a (const 
 char *) to a text string or I was thinking of a character array.
 
 My mind is mush at the moment - can't seem to recall the way to program a 
 conversion of 
 
 float fv = 40.0; 
 
 into
 
 const char *text = 40.0;
 
 or 
 
 const char text[ ] = 40.0;
 
 
 Please advise...
 
 Thanks YT
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
 
 This email sent to rm...@latencyzero.com


-- 
Rick




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com