For those who were in the last meetup - how's your progress on assignment #3?
Can we finish it by this Thursday?
Me, I'm almost done. I just have to work on the persistence part (requirement #8). I can make it by Thursday, but I will not be able to work on the extra credits items. If we do the meetup next week I can work on the extra credits.
For those catching up, have you done Assignment 2? Any problems so far?
rad
I also had a hard time formatting the code snippet from the assignment
PDF for determining the points in the polygon, so I'm including that
method here in case you need to copy and paste to your code (and do
not want to waste your time fixing the syntax).
+ (NSArray *)pointsForPolygonInRect:(CGRect)rect numberOfSides:
(int)numberOfSides {
CGPoint center = CGPointMake(rect.size.width / 2.0,
rect.size.height / 2.0);
float radius = 0.9 * center.x;
NSMutableArray *result = [NSMutableArray array];
float angle = ( 2.0 * M_PI ) / numberOfSides;
float exteriorAngle = M_PI - angle;
float rotationDelta = angle - ( 0.5 * exteriorAngle);
for ( int currentAngle = 0; currentAngle < numberOfSides ;
currentAngle++) {
float newAngle = (angle * currentAngle) - rotationDelta;
float curX = cos(newAngle) * radius;
float curY = sin(newAngle) * radius;
[result addObject:[NSValue
valueWithCGPoint:CGPointMake( center.x + curX, center.y + curY)]];
}
return result;
}
Might not be available this coming Thursday (as another group from our
church might start meeting regularly on this day) but I'll try to free
up my other Thursdays so I can catch up with the group.
Thanks,
Paul
On Feb 23, 9:14 am, Radamanthus Batnag <r...@batnag.org> wrote:
The Controller object has the connections to the UILabels, UIButtons,
PolygonView and PolygonShape wired through Interface Builder. (no
alloc/inits inside my classes)
My MainWindow.xib is structured similar to below:
MainWindow.xib
- FO
- FR
- App Delegate
- Window
- Labels
- Buttons
- Poly View
- Label
- Controller
- Poly Shape
My Controller calls appropriate method in view when the inc/dec
buttons are clicked. This means the Controller contains the IBActions
for the buttons.
ApplicationDelegate also holds reference to Controller so I can set/
save the number of sides during startup/shutdown.
Hope I provided enough to get you started without giving away too much
info. :)
If there are better alternatives, please feel free to send in your
suggestions. ;)
Care to share high level overview of your solution Rad?
Cheers,
Paul
On Feb 28, 3:50 pm, Eumir Gaspar <imacaterpil...@gmail.com> wrote:
> I meant increase/decrease buttons, sorry.
>
One difference is I did not make my Controller an ApplicationDelegate but instead used NSNotificationCenter. I'm still studying when it makes sense to use delegates and when it is better to use notifications.
We're all set for session #3 this Thursday, right?
Any suggestions for a venue? How about Coffee Bean in Emerald Ave., Ortigas?
r
I'm currently having trouble with my UIView subclass; specifically, I
added a property to the subclass to hold the number of sides of the
polygon, but it seems to lose the value by the time it gets to the
drawrect method.
----------------------------------------
// DrawPoly.m
#import "DrawPoly.h"
@implementation DrawPoly {
int polySides;
}
@synthesize polySides;
-(id)init {
return [self initWithSides:6];
}
-(id)initWithSides:(int)newSides {
self = [super init];
self.polySides = newSides;
[self setNeedsDisplay];
return self;
}
------------------------------------------------
So when I initialize it, the polySides property has the number of
sides, but by the time I reach the drawRect method:
--------------------------------------------
-(void)drawRect:(CGRect)rect {
//get the points
NSArray *polyArray = [DrawPoly pointsForPolygonInRect:rect
numberOfSides:self.polySides]; // this doesn't work, polysides is 0
// NSArray *polyArray = [DrawPoly pointsForPolygonInRect:rect
numberOfSides:6]; // this works
NSValue *value;
CGPoint point;
...
--------------------------------------------
the polySides property is now 0, as verified in the debugger. What
gives? Any idea?
Welcome to the Cocoa Heads mailing list / CS193p study group.
Can you check if you have multiple instances of the DrawPoly class
running in your application? That was originally my problem. I already
had it wired in IB then I also created another instance using alloc/
init. I saw my polygon updating in the logs, but not in the view. All
the problems went away when I removed all alloc/inits in my code and
moved the creation to IB.
If you're interested, you can send me your copy and I'll try to run it
on debug mode from my machine.
Cheers,
Paul
So what I have that I can reuse:
- I have a PolyShape class, which I will use as the model in my
VMC.
- I have the guts of my DrawPoly class, which is capable of drawing
the poly (calling directly), but seems to forget how many sides the
poly is supposed to have (my plan is to have the controller get the
sides from the PolyShape class, then set it in the DrawPoly class,
then have the DrawPoly class draw itself.)
So I have those, but where exactly should I actually allocate, init
and add it to the view controller's view?
Because everything is wired in IB, the alloc/init call to your view
will be done when MainWindow.xib is loaded (calls awakeFromNib).
Hope that helps! Please feel free to post any other follow up
questions you may have.
Cheers,
Paul
I thought you had to make a UIView subclass and wire it up from
scratch to get this to work.
I thought you had to make a UIView subclass and wire it up from
scratch to get this to work.
On Mar 3, 8:02 pm, paul_sns <plab.s...@gmail.com> wrote:
I thought you had to make a UIView subclass and wire it up from
scratch to get this to work.
On Mar 3, 8:02 pm, paul_sns <plab.s...@gmail.com> wrote:
Paul
Cheers,
Paul
On Mar 4, 12:37 am, Radamanthus Batnag <r...@batnag.org> wrote:
> I'm game for tomorrow, 730pm onward.
> Anyone else coming?
>
> On Mar 3, 2010, at 8:10 PM, Eumir Gaspar wrote:
>
> > As for the meetup, is everyone game for tomorrow?
>
> > As Rad said:
> > Any suggestions for a venue? How about Coffee Bean in Emerald Ave., Ortigas? <-- im okay with this but i really still dont have a clue(i will try to work on it again later based on the discussion here), if ever, maybe one of you can discuss this to the others who haven't completed as well?
>
Those of us from Devex will be here anyway.
If you haven't done the assignment, you can do it during the meetup,
or just participate in the discussion of the solution.
I probably sound stubborn in pushing for the meetup despite the lack
of numbers. I am. We're at assignment 3, week 3, lecture 6, and around
the time I stopped my CS193p self-study last year. I don't want to
repeat again :p
The key difference is that I didn't work on any of the assignments
last year. I only started working on them this year because of peer
pressure, I mean motivation from the study group. ;) I also encourage
the others to work on the assignments, as this is the only way we can
learn. We can watch the videos all day long and not learn anything,
which is what happened to me with the first round of the Stanford
lectures.
I'd love to join tonight's session but I think it's already too late
to tell my significant other that I would be leaving the house in a
few minutes. We're both home based and we currently do not have house
help so it's really hard to go out with such a short notice,
especially with two kids fighting for attention. I hope you guys would
understand.
As always, please feel free to send notable discussions regarding the
meeting.
Rad, sorry di ako maka reply sa text mo. Di pa ako nakaka load since
the other day. :)
If you want, we can also exchange assignments through email so we can
compare notes. How does that sound?
Thanks,
Paul
On Mar 4, 5:51 pm, Radamanthus Batnag <radamant...@gmail.com> wrote:
> Let's do the meetup at the Devex.com office:
> 1901 Orient Square, Emerald Ave.
> 730pm onward.
>
> Those of us from Devex will be here anyway.
> If you haven't done the assignment, you can do it during the meetup,
> or just participate in the discussion of the solution.
>
> I probably sound stubborn in pushing for the meetup despite the lack
> of numbers. I am. We're at assignment 3, week 3, lecture 6, and around
> the time I stopped my CS193p self-study last year. I don't want to
> repeat again :p
>
> On Thu, Mar 4, 2010 at 5:39 PM, Radamanthus Batnag
>
> <radamant...@gmail.com> wrote:
> > Do we do the meetup? I'm ok either way, but I'm out of town next week.
>
> > On Thu, Mar 4, 2010 at 12:14 PM, Christopher Rigor <cri...@gmail.com> wrote:
> >> I can attend, but I'll start doing the assignment there :)
>
> ...
>
> read more »
No worries, I understand your situation. I'm lucky to have househelp now, but I've been in your situation, too. Tough.
During last night's sessions, we discussed assignment #3. Eumir worked on it, but got stuck on how to connect the PolygonView to the controller and the PolygonShape model. Your email earlier this week more or less described my similar solution. It was just easier to discuss concepts and code in a meetup.
For the next two weeks, we'll do lectures 7 and 8, and assignment 4 (Paparazzi 1).
Also, it looks like a significant number of people on the list are falling behind and are still not done with the earlier assignments. If there's enough interest, maybe we can do a short session on assignments 1B and 2A. Lurkers, interested?
Regards,
rad
This post in the Apple developer forum also helped me realize what was
going wrong: http://discussions.apple.com/message.jspa?messageID=11167725
I'm posting this for a friend. The company will be building iPhone apps that talk to an RoR backend.
Work will be home-based, San Francisco time.
rad
---
Iphone App Developer for a Telephony Startup Firm
We are seeking a top-caliber, enthusiastic lead iPhone developer to join our promising firm as a core member of an experienced, leadership team. The role will require design initiative and team collaboration, as well as extensive, efficient coding. The iPhone developer will report to and collaborate with the CTO to deliver a novel platform from the ground-up.
REQUIREMENTS:
- Bachelor's degree in Computer Science or equivalent
- Expert-level proficiency of object-oriented programming in Objective-C and software design patterns
- Advanced knowledge of the iPhone SDK platform frameworks
- Experience setting up and maintaining an iPhone application project, including setting up ad-hoc distribution of builds
DESIRED:
- Experience with Core Audio and the new Media Player framework in iPhone SDK 3.0
- Experience with Internet communication (i.e. Core Foundation NSURL APIs) and parsing data (XML, JSON, etc)
- Familiarity with digital media and streaming
- Familiarity with Ruby on Rails
Compensation will be commensurate with experience and highly competitive skills.Please email resume at in...@wideumbrella.com