Hi,
I am developing an iPhone application using SFS Pro and the iPhone API. Everything has been running smoothly but I am running into a bizarre situation. Part of the iphone application involves displaying a scoreboard. An SFS extension sends the data in an array to be displayed to the iPhone. However, when I receive the array in onExtensionResponse it is out of order if the number of elements is 5 or more. For 1-4 elements, it is backwards.
Here is what I have on the SFS extension:
var response = {}
response._cmd = "getDailyResults"
response.result = []
response.result.push("one")
response.result.push("two")
response.result.push("three")
response.result.push("four")
response.result.push("five")
response.result.push("six")
response.result.push("seven")
response.result.push("eight")
_server.sendResponse(response, -1, null, [user])
I check to make sure that the response.result array is correct, so I trace it before sending and it displays "one" through "eight" in the proper order.
On the iphone side, I have:
-(void) onExtensionResponse:(INFSmartFoxSFSEvent *)evt {
NSDictionary *response = evt.params;
NSDictionary *theData = [response objectForKey:@"dataObj"];
NSString *command = [theData objectForKey:@"_cmd"];
if ([command isEqualToString:@"getDailyResults"]) {
NSArray *results = [theData objectForKey:@"result"];
for (int i=0; i<[results count]; i++) {
NSLog(@"%@", [results objectAtIndex:i]);
}
}
}
When I look at the iphone console I get:
2010-02-21 13:00:19.680 [8779:207] four
2010-02-21 13:00:19.682 [8779:207] three
2010-02-21 13:00:19.682 [8779:207] two
2010-02-21 13:00:19.683 [8779:207] one
2010-02-21 13:00:19.684 [8779:207] eight
2010-02-21 13:00:19.685 [8779:207] seven
2010-02-21 13:00:19.686 [8779:207] six
2010-02-21 13:00:19.687 [8779:207] five
The same thing happens if I use the integers 1-8 as opposed to strings.
Any ideas? Why are the indices shuffled?
- Board index SmartFoxServer Pro/Basic 1.x Client API - SFS 1.x iPhone Objective-C API
- Search
-
- It is currently 10 Feb 2026, 15:18
- All times are UTC
extension response array out of order
Post here all your questions related with the SmartFoxServer iPhone API
Return to “iPhone Objective-C API”
Jump to
- SmartFoxServer 2X
- ↳ SFS2X Questions
- ↳ SFS2X Client API
- ↳ SFS2X ActionScript 3 API
- ↳ SFS2X C# API
- ↳ SFS2X iPhone / iPad / OSX API
- ↳ SFS2X Java / Android API
- ↳ SFS2X HTML5 / JavaScript API
- ↳ SFS2X C++ API
- ↳ RedBox 2X
- ↳ 2X Features Wish List
- SmartFoxServer Pro/Basic 1.x
- ↳ SmartFoxServer 1.x Discussions and Help
- ↳ Server Side Extension Development
- ↳ BlueBox
- ↳ RedBox
- ↳ Features Wish List
- ↳ The Bug Trap
- ↳ Client API - SFS 1.x
- ↳ .Net / Unity3D API
- ↳ iPhone Objective-C API
- ↳ Silverlight API
- ↳ Java2SE / Android Client API
- ↳ Other Client API
- OpenSpace Support
- ↳ OpenSpace v2 discussions and help
- ↳ OpenSpace v1 discussions and help
- SmartFoxBits Support
- ↳ SmartFoxBits for SFS 2X
- ↳ SmartFoxBits for SFS 1.x
- Community
- ↳ Job offers and requests
- ↳ The Gallery