« first day (942 days earlier)      last day (1214 days later) » 

3:00 PM
I have a plist with Item 0 - Item 11.
I load this array of Items. And then print each item.
My for loop keeps throwing an exception though
It prints all but the last item, (An NSString), then tells me it is out of bounds.
It also does print the first item.
for(int i = 0; i < array.count; i++)
 
what is the last item it prints?
index 10?
 
Yep.
 
pastebin the code within the loop
 
Sure
 
is the array a simple array = [NSArray arrayWithContentsOfFile:]?
 
3:04 PM
Yes.
 
figures
 
That has != inside the for loop, but it's been changed just to test.
 
the index out of bounds will be on one of the arrays
this is not a safe structure you have there
you assume all arrays have the same length
well obviously one of them is shorter
 
I checked them.
I'll look again.
 
why a dictionary of arrays and why not an array of dictionaries?
feels like you are doing it the wrong way around
then each dictionary would correspond to a Planet object
 
3:10 PM
I've rarely used plists, so was just following a simple tutorial.
I recognized the pitfall of one array being too short, but I was sure I filled them all
 
yes but that assurance should come out of the structure not the data
 
I found the missing Item.
 
whenever you design any sort of data structure it is the structure that has to be safe not the data it holds
 
Should I just do nested dictionaries in arrays?
 
if I were you I'd create a Planet class that conforms to NSCoding and serialise them instead of using a plist
that's still safer yes
 
3:12 PM
Array [ . . . Dict >[ Name, Mass, ...]]
 
yep
 
That sounds good, but I've got no idea how to do it.
 
very easy though
NSCoding couldn't be simpler
 
I've actually got planet classes.
 
then definitely do that!
 
3:13 PM
But I load data from the plist to them.,
 
ah I see
 
Well, that's how I decided to do it right now.
 
well, then do a -[Planet initWithDictionary:]
if you go with NSCoding you won't really be able to manually create the data to load the planets
 
Okay then, so I restructure my Plists, then init objects with dictionaries
 
the result of NSCoding isn't really human readable
yes
 
3:15 PM
@rage Well then what is the point? To write to the file yourself in the App (Where you might as well use what you loaded)?
Unless you can save different stuff there
Then it's useful I suppose.
 
well, it's for saving stuff to disk and reloading
like app state
you might have noticed that's how UI State Restoration works
 
I probably should create more extensive structures.
Since I not only need planets
 
moons?
 
No, Moon has have a NSString property that describes them.
As moons.
Systems
As in, Planet-satellite pairs.
Eh, that will come later.
I just need this to work for now.
 
Keep calm and carry on coding
 
3:21 PM
So should I name each dictionary in the array after the planet I want?
 
you don't name an element of an array
 
Oh right.
Well I can name them in the plist.
Just not extract that later I suppose.
 
then you aren't creating and array
 
Damnit
I am putting a dictionary in a dictionary
 
bingo
 
3:28 PM
It's such a pain to redo this. \
So many classes use the planet class
I must have over 30 errors to handle.
When I finish updating the plist
 
i also do most of my stuff with NSCoding when not bunging it into core data
but mostly i put them in core data
 
yes, but this is a case of pre-loading
slightly different
 
yeah you can just subclass the planets and call the super encodeWithCoder / initWithEncoder as part of the load process, alrternatively i would have still done it with a Fetched Results Controller though tbh
 
yeah, but let's not confuse Oswatch with CD just yet
initWithDictionary: will do just fine
 
I only hear complaints about it.
And I don't need relationships between data or anything.
 
3:34 PM
Keh ? CoreData is like looking into the face of god
no but you need persitence
 
This is just static info to be loaded in scene.
 
and faith
 
and CoreData is so easy id say easier than plist parsing
 
defo easier
 
It is easier?
 
3:35 PM
if you are ordained
 
Should I remove the plist?
 
no
stay with it
work iteratively
 
and dont fear the unkown, as we all know, fear is the mind killer
 
get it working then improve
:)
I got a pair of new t-shirts: "It is by will alone I set my mind in motion"
 
I am loading the array using arrayWithContents of file.
 
3:37 PM
that's fine for now
 
So now I assume I should just parse the array, and then pass each dictionary to the Planet subclass so it can initialize itself with the information.
 
take a good long look at this: herdingcats.typepad.com/.a/…
2
that's exactly what you want to do right now
 
Haha.
 
make it work in whatever way and then decide if you need to improve one part or another
can you star that link please? maybe others will benefit from it as well...
 
ive been coding Lib code in swift for days now
about to write all the unit tests to se what breaks
going to b fun fun fun
 
3:47 PM
surely you wrote the unit tests first
 
What happens if I add an NSString to a plist?
And I do not write anything in it?
 
then it will be added
 
Is it ""
Or NULL
 
neither
it's @""
 
-_-
 
3:51 PM
assuming we are in Obj-c
 
Yes, we are..
Okay.
 
in this case i did not
which yes is wrong
but i knew not enough about swift when i started
think im up to speed now though
or as far as i can get with this version of Swift
 
I should do some more swift myself
I'm still struggling sometimes
 
yeah its almost worht waiting for the next version
im going to have to likely rewrite stuff as pure swift API's and Frameworks are introduced
but in theory the Unit tests will be really useful then
there is some really odd language bits though that differ from every other language i have ever done
makes it tricky to pick up
 
Anyone good with Tables?
I just want to split mine into two sections
 
3:56 PM
define table
 
UITableView
 
tableviewcontrollers ?
use a UICOllectionView
and you can just define it in the properties
 
I've got a custom controller.
with a UITableView
 
4:13 PM
go with what Jim says
UITableViews are so last year
they aren't fab at all
see ya tomorrow guys
 
What do you mean?
 
TabelView is old hat
 
What's the new thing?
 
damn it
I am the stupid one today, I can't believe I am leaking memories here and there.
 
I think its as old as iOS 4 and its collection views
 
4:27 PM
I'm always behind the times. . .
My phone will be phased out this year, my laptop is already phased out, and I'm using outdated views.
And I don't use swift.
Which it seems everyone ought to be transitioning to.
 
this is years old
id say wait for swift to mature a bit
and core data is something you should toally learn
as you will end up loving it
 
This is my first Application.
So I'm sure I will use it eventually.
I'll get to learn it.
 
lol
Tried loading array, it is totally blank.
FFS
(UITableView is supposed to use data from an array which is filled using the plist)
 
4:55 PM
I've got the Moon and the Earth in a shifting binary orbit.
But the moon is much heavier than it should be.
lolol
The earth now orbits the moon
 
I don't think I get the joke. :(
 
What joke?
 
Exactly. I meant the moon/earth stuff. Is that what you're working on?
 
Yeah.
My app simulates gravitational forces
 
Ooh, neat.
 
5:02 PM
So I added the Moon and the Earth
But the moon is 1/4 the earth mass in the scene
Where it really is about 1%
 
That'd do it.
 
So the orbit was binary.
Then I increased the Moons mass to greater than the earth
And the earth began to orbit it.
Which was funny looking.
 
A few years ago now I had an app on the store that simulated inverse-square particle interactions, though I was simulating electrostatic forces, not gravitational.
I remember having lots of problems with decaying "orbits," because my timestep was not granular enough.
 
I'm using Velocity Verlet Integration for mine.
Objects should not lose energy.
I will have to check the behavior later.
Hard to tell if it's working right since I manupiluate orbits by hand and stuff.
 
That makes a lot more sense. I just used the most simplistic algorithms I knew, which ended up be physics 101-style kinematics.
 
5:07 PM
I did the same last month
They actually didn't seem to bad.
But objects did not retain energy, and quickly collided with the other object after a few orbits.
 
Yup, exactly. I'd start perfectly circular orbits in the simulator via code, and they'd deviate.
 
That is what I am afraid of.
I haven't tried it yet, but I have a class set up for systems
Which is supposed to set up an object exactly perpendicular to another going straight off in one direction.
The velocity determined so that the orbit is circular (Or as circular as possible).
Last time mine did not keep perfect orbits
Hold on I will show you
These are outdated for a while.
But they do show how orbits were not exact
 
See, the problem was that I had to decrease timestep to do so
But nobody wants to watch something crawl across the screen
 
Haha of course.
 
5:11 PM
Velocity Verlet should not do that.
It should be quick and retain energy,
 
Here's hoping./
 
Check this
They use the same equations I am, and they got it working
 
That's promising for sure.
 
Yeah.
There's much work to do.
I need to put back tracing in.
It doesn't work right.
And if you looked at that picture you linked, the FPS is very low, due to a problem from drawing lines in SpriteKit
I think (if I can), I will use OpenGL for that.
 
is it jsut in 2D mutch ?
 
5:29 PM
I cut myself, and got shaving cream up my nose today.
:<
 
5:39 PM
Hey guys :D
Sup? :P
 
Not too much.
 
How is the project going?
 
Went well today.
 
Cool :)
Owatch , did you ever used PHP and Objective c . Swift together?
 
I'm busy working out how to add Systems.
 
5:42 PM
Same here lol
 
Rather than individual planets
 
I'm going online
and thats a big problem arg
 
What do you mean online?
On your App?
 
Yes.
 
What does it do again?
 
5:44 PM
I'm echoing Json array to my app, and i cant parse it for some reason
 
I should ask lespommes about his game.
 
Well it's a new one so i cant really talk about it haha , it's going to be huge
 
Are you afraid I will somehow create your app before you can?
lol
Unless it's not your app and you're under some general NDA.
 
whats NDA?
 
Non Disclosure Agreement.
Companies issue to employees to protect their business.
 
5:48 PM
Oh lol i had no idea
well its just i dont like talk about new ideas
 
It's fine.
Is it a game or utility?
Or is that too much info too .
I sort of told everyone about my game.
Luckily I didn't make it some public git project though.
That would be a bad idea.
 
lol
Utility
First of his kind
i actually left everything
and started it
lol
 
Left everything as in your job?
Your home?
Your family?
Damn this must be a good idea.
Don't tell anyone for sure.
 
ahah
nono
all othes projects
 
Oh
 
5:59 PM
haha
well that escaliated quickly
 
 
1 hour later…
7:15 PM
@rage @eddwinpaz are here
 
yes
 
 
3 hours later…
10:06 PM
wake up @Guilherme !!
 
10:27 PM
Who dares to call my name?
 
Mutch asked me to.
 
Any chance anyone in here have experience merging into a remote github branch in Xcode?
 
Hi room.
 
Duncan has experience
 
Hi
 
10:35 PM
I haven't done much with branches, although it isn't that hard.
What's the question?
 
who is mutch?
 
Mutch95. His avatar is a Pokemon.
 
why did he ask?
 
A Pokemon with an ice cube tray, apparently.
 
please, ask quickly, as I'll be leaving soon
 
10:37 PM
I have an existing project, that I need to commit to a remote branch on GitHub. However I did my first original commit, only to a local repository. So when I press commit, I can only commit the few changed files. And I need to commit my entire project.
 
looks like a pokemon who was set on fire playing with a pc keyboard
 
Do you have the remote set to the Github project?
 
Mark, you should take the Try Git course on CodeSchool (it's free)
 
yeah. It's connected successfully
 
So you commit locally, then push. It should push everything needed to bring the project up to date.
 
10:39 PM
I just can't find any way to merge my project into the remote branch. If I make a new local branch, I can use "merge into" but I don't have that available for remote branches.
if I click "Push" It says "Working copy out of date" try pulling from the remote to get the latest changes, then push again.

But if I try to pull it says it's "not a valid branch to pull from"
 
You created the branch on your local machine, not on the server?
 
it's on the server. I have access to it on github. But of course, there's no files in it. Except for the standard readme file
 
What you're supposed to do is create a new branch on the server, switch to the branch, then make your changes and push.
 
unless you're asking about the branch I made the mistake to commit to originally then yes. I commited to a local branch called "master" >_<
 
Finally, merge.
Does the branch exist on the server?
 
10:44 PM
the branch I'm wanting to commit to is called "Mark", which exists on the server yes.
I tried creating a new branch through Xcode, but it only creates a local one. I havn't been able to find a way to create a remote branch in Xcode
 
I think you may have to put your changes in manually. Copy your project folder to a different directory. Check out a fresh copy of the project from the server. Switch to the branch. Copy/paste each changed file into place (or touch the changed dates for non text files) Then commit, push, and merge.
Are any of you working in Swift? (I know Max is.)
I'm starting to get the hang of it.
 
ahh, yeah I suppose that will do the trick. I'll go ahead and try that. Thanks
and I'm working in Swift
 
Are you familiar with the Unix touch command?
 
I'm afraid not
 
Or I have a Cocoa touch program I wrote that I can give you. You drag files onto it and it updates their mod dates.
The unix touch command is trivial to use.
"touch <filepath>" from terminal.
I was pleased to find that property observers fire if you have an array property and modify an element in the array.
That's not true in Objective-C. If you have an array property and change an element of the array, it doesn't fire the setter.
hang on. Doorbell.
 
10:53 PM
Sorry. I was already trying to figure out how to properly add files to the branch. Actually I'd love to see if the cocoa touch program to update modified dates work. As I'm having some issues copying it over correctly.
 
 
1 hour later…
11:58 PM
@MarkL, are you still there? I was AFK for quite a while.
Send me an email and I'll email you the Mac "touch" program I wrote. Failing that, just type "touch " in terminal, and then drag a file that you want to touch onto the terminal window. It will put the full path to the file in the command line and you just press return.
 

« first day (942 days earlier)      last day (1214 days later) »