swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swarm-Support] What is the best way to model "lists" of integers in Obj


From: Luke Premo
Subject: [Swarm-Support] What is the best way to model "lists" of integers in Obj-C?
Date: Tue, 06 Feb 2007 22:46:37 +0100
User-agent: Internet Messaging Program (IMP) H3 (4.1)

Hello,
I would like to use "lists" of (negative and positive) integers in my Obj-C model (Mac OSX, Swarm 2.2) to represent simple genomes. So far, I've used the List object to do this, but i get some strange results (i.e., getCount returns 10 but when I print out the contents of the "haplotype" I don't always get 10 integers...sometimes i get none) not to mention the following compiler warning: Hominin.m:38: warning: passing argument 1 of 'addLast:' makes pointer from integer without a cast. I get the feeling List is only reliable for objects and not integers, is this true? And if so, what would be a better choice for me given that i want to be able to add/remove integers with offsets and use the addLast/First and removeLast/First commands when modeling recombination between two "lists" of integers? Should I switch to Arrays, Collections, or Strings to do this?

If my hunch is wrong, and Lists can deal with integers just fine, then how come I can't get all 10 of the integers to print out for me using a while loop on an index of the haplotype List and the printf function? I'm stumped.

I'm sure this is a simple problem, but I've been unsuccessful in finding a definitive answer after searching for the last couple of hours. I would greatly appreciate any suggestions. Thank you very much for you time,

Luke Premo



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]