Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-11-2012, 05:03 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2011
Posts: 7
cs_iris is on a distinguished road
Question java arrayList to xcode ArrayList

Hello, everyone!

import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.LinkedList; import java.util.StringTokenizer; import javax.swing.JOptionPane;

public class mainProgram extends javax.swing.JFrame {
ArrayList computer = new ArrayList();
ArrayList science = new ArrayList();
--------
public mainProgram() {
initComponents();
computer.add("sx"); computer.add("1 /x");


I am converting a java code into an xcode, and currently I am already in the solution part of our program. But we are having a problem in the arraylist, an error appears when we type only the "ArrayList computer = new ArrayList();" and cannot continue anymore. Can anyone help us?

I've used the NSArray in the header.. but I don't know what to write in the .m of the code.

thank you.

Last edited by cs_iris; 01-11-2012 at 05:54 AM.
cs_iris is offline   Reply With Quote
Old 01-11-2012, 07:42 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 114
TelTikky is on a distinguished road
Default

Java does not translate directly into objective c. ArrayList to NSArray is okay though.

Try this:

Code:
NSMutableArray *array;                      
array = [[NSMutableArray alloc] init];                                  
NSString *str = [[NSString alloc] initWithString:@"sx"]; 
[array addObject: str];
[str release];
TelTikky is offline   Reply With Quote
Reply

Bookmarks

Tags
arraylist, convert, convertion, java, xcode

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 390
11 members and 379 guests
7twenty7, Atatator, buggen, guusleijsten, j.b.rajesh@gmail.com, morterbaher, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:37 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0