Stanford CS193P iPhone Programming Course Assignment 1B

I do not understand this assignment at all...*I'm not doing it for the class*, but I've downloaded all the materials from iTunes U and the course website. I was looking through it, and I have no idea what to do for assignment 1B.
Assignment 1B
Course website

Here's a basic layout of what I think the skeleton of the program would look like:
#import <Foundation/Foundation.h>
void PrintPathInfo (); // function declaration for section 1
void PrintProcessInfo (); // function declaration for section 2
void PrintBookmarkInfo (); // function declaration for section 3
void PrintIntrospectionInfo (); // function declaration for section 4
int main (int argc, const char * argv[])
NSAutoreleasepool * pool = [[NSAutoreleasePool alloc] init];
PrintPathInfo(); // function call for section 1
PrintProcessInfo(); // function call for section 2
PrintBookmarkInfo(); // function call for section 3
PrintIntrospectionInfo(); // function call for section 4
[pool release];
return 0;
void PrintPathInfo () // function definition for section 1
// code for printing "path info"
void PrintProcessInfo () // function definition for section 2
// code for printing "process info"
void PrintBookmarkInfo () // function definition for section 3
// code for printing "bookmark info"
void PrintIntrospectionInfo () // function definition for section 4
// code for printing "introspection info"
I don't know how to help you any further without actually doing the assignment myself, which I unfortunately don't have time for right now, but I may try in the future sometime, because it looks like I could benefit from it. But this skeleton code should give you an idea of what the basic program would look like, so all you really need to know now is what code to put in the four function definitions, so you just need to figure out how to print the "path info" and the "process info" and so forth. Go to page 4 on the assignment document you linked to and start with the section titled "Section 1: String as file system paths" and read through that to try to figure out what code you need to write in the first function definition (the one for PrintPathInfo()), and then do the same for the other three. That's where I would begin. If you don't understand what your being told in those sections of the assignment document, then maybe it is too advanced of an assignment and you might need to learn a little more about the language first (I'm not sure I know enough to complete it myself, but then again, I don't know much about Objective-C in the first place). But, anyways, that's what I would do if I were you. I'd copy the skeleton code above into your project (assuming you understand it) or write your own, and then start reading the assignment to figure out what goes inside the function definitions, because everything else (the function declarations and the main() function code) is already done. It's possible you may need to add arguments to some of the functions as you write them and/or change their return types, but it doesn't look like it. Anyways, hope there was something helpful here.

Similar Messages

  • Can someone point me in the direction of iPhone Programming Courses

    Ive never programmed anything except basic HTML but I would really like to learn how to program for the iPhone can someone point me in the direction for any Online Courses for learning Objective C?

    I dont thank you mean learning c++ or C#, I think you would just like to know how to create basic apps. Well I would like to do the same thing. Check out this link ( http://ifones.com/apple-iphone-sdk-tutorial-top-picks/ ) it should point you in the right direction like it did for me.
    Enjoy!

  • I have an iPhone5 16 gb and a 120 gb iPod. All my songs won't fit on the iPhone of course. How can I just get some of them on the iPhone? I want to keep all my music on the iPod. I am VERY new to all this so be gentle and thanks.

    I have an iPhone5, 16 gb and a 120 gb iPod. All my songs won't fit on the iPhone of course. How can I just get some of them on the iPhone? I want to keep all my music on the iPod, but just want SOME of my music on the iphone. I am VERY new to all this so be gentle and thanks.

    You Sync the Music you want on the Phone via iTunes on your computer.
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/

  • Hi, I followed the instructions to apply for the Made For iPhone Program. After submission of the necessary documents and information, I have not heard back from Apple. How to track the application progress? Can someone help?

    Hi, I followed the instructions from Apple MFI website, to apply for the Made For iPhone Program. After submission of the necessary documents and information, I have not heard back from Apple for couple weeks. How to track the application progress? Can someone help? < Edited by Host >
    Thank you.
    Best Regards,
    Gerald

    Hi Gerald
    This is a user-to-user forum, and your message will not be received by Apple. You will need to sign into your Developer/MFI account, and contact Apple that way. This can be done here.
    P.S Please do not post your e-mail address here.
    Taylor

  • "Works with iPhone" Program

    Has anyone had success in enrolling in the "Works with iPhone" program? I am designing an accessory right now but have not heard back from Apple. How long did it take to get a response? What was the process you went through?
    Thanks.

    No. I am already part of that.
    This program is if you wanted to design your own stereo that works with the iPhone (for example).

  • Where to learn iPhone programming

    Hi.
    I'm totally new to iPhone or any other type of programming and I have never built any application but I really want to learn to program for iPhone in the latest iOS 4 Xcode. I have searched a lot for tutorials but any have the sufficient information or begin to explain as if the viewer already has experience with objective-C for example.
    So does someone knows where can I find good tutorials for people who have never programmed in their lives for iPhone specifically?
    Thanks a lot.

    I would recommend you not to use tutorials but to read books on Obj-C, because they give a more complex knowledge of programming. For an absolute beginner, I'd recommend "Programming in Objective-C" by Stephen Kochan. This book will give you yhe basis of Mac OS and iPhone programming. Then you should read this book: "Beginning iPhone 3 Development: Exploring the iPhone SDK" By Jeff LaMarche and David Mark (http://www.apress.com/book/view/9781430224594). (btw, there are also some other great books on iPhone programming by these authors).
    Hope it helps,
    Mike

  • Load Program to Assign Class to Routing Operation

    Hello Experts,
       I used the standard batch direct input program to load Routings/operations/bom component allocation etc.
    We also have a requirement to assign Class(for class type 018) to each of these operations.
    Please suggest a standard load program to assign classification to a routing operation.
    Thanks
    Kishore

    Found the answer

  • JSP Programming Course Available

              Hello:
              wAppearances now offers a 5-day hands-on JSP programming course.
              Visit www.wAppearances.com for details.
              Robert Burdick
              wAppearances
              Co-author, "Professional JSP, 2nd Edition," Wrox Press.
              

    Hi Neha,
    there are two different runtime options in MI - JSP and AWT - that you already mentioned corredtly.
    Depending what dev model you choose, you have to install the related runtime. That is a logical step. Well, if you are aware, JSP pages are displayed in a browser and are hosted on a server. In our case MI client JSP runtime is that server and especially if you run the application on a small device like a PDA, you will see significant performance issues. The screen response time is something around 2-5seconds. this is due to the messages and the processing time of the different components.
    If you use AWT on the other hand, you are running it in the MI AWT client runtime and so all runs as a single application. This has a better screen response time.
    So from this perspective the decision should clearly be the AWT component. BUT!!!
    If you ever have developed an AWT app, you have noticed, that it is not that easy to develop tables for example in AWT. It is possible, but it is getting complex and slow soon. So depending on the complexity of your screens it can be soon, that JSP itself has a faster rendering time then an AWT application. And because JSP screen development is taht simple, most apps are JSP apps at the moment.
    With MI7.1 this will change. You have the possibility to use eSWT and WebDynpro for UI development as well, and so the development of MI applicartions that use les system performance for the runtime itself will be more easy.
    Hope this helps!
    Regards,
    Oliver

  • IPhone programs not syncing to iTunes.

    When I connect my iPhone to my computer iTunes open and it syncs stuff automaticly, but it didn't sync the programs I recently installed and I don't know why. So I'm wondering how I can do that?

    This forum is for iTunes U (iTunes for Universities) please post your question in the regular iTunes or iPhone forum - https://discussions.apple.com/index.jspa?view=overview

  • IPhone Programming: Action triggered by clicking on alert.

    Hey Guys,
    I have what I suspect should be a pretty easy question.
    I'm still working on a Blackjack program. Basically the player goes to hit or stand, and then the game automatically has the dealer deal itself (hit on 16, stand on 17).
    Once the dealer is done dealing I want you an alert to come up. But I only want to call the routine after the user hits the OK button on the alert.
    How can I go about doing this. I know with an Action Sheet you can trigger something to happen when a given button is pressed, but I want to really be able to do this with an alert. The way I would think this would be done is to see when the user taps the Ok button in the alert. Any idea how to do this?
    Thanks!
    Justin
    Message was edited by: Justin Carman

    Can you provide me a code example of how this would work (the alertDidEndSelector)?
    I ask this because apparently you can't really use an NSAlert with the iPhone (I keep getting NSAlert undeclared errors), so that eliminates that way of doing it.
    Thanks!
    Justin
    Edit:
    One other thing I noticed is that you could do this
    UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"Alert title" message:@"alert message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
    [myAlert addTextFieldWithValue:nil label:@"<place holder>"];
    [[myAlert textField] setTextAlignment:UITextAlignmentCenter];
    [[myAlert textField] becomeFirstResponder];
    [myAlert show];
    [myAlert release];
    myAlert = nil;
    And also have this...
    - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
    switch(buttonIndex) {
    case 0:
    [myString setText:@"Cancel button pressed"];
    break;
    case 1:
    [myString setText:[[alertView textField] text]];
    break;
    The only problem is for me...I don't know how I would handle input from multiple different alertViews that I have in my program. Any ideas?
    Thanks!
    Message was edited by: Justin

  • Want to learn iPhone Programming on 10.5 PPC, can i do this?

    I want to self teach my self to program iPhone applications, i have no programming experience so inwill be starting from scratch. I have got the book 'Objective-C For Absolute Beginners' but before I begin I wanted to check I can learn using my system. I have a iMac G4 PPC running Mac OS X 10.5 Leopard which means I cannot run the latest version of Xcode. Is the latest version of Xcode that can run on 10.5.8 and on a PPC machine okay for me to practice and learn how to use Xcode and program for the iPhone? Because I don't have the money but when I can afford it I will upgrade to an intel computer maybe in a years time. But will it do for now?

    AndiWhitts wrote:
    Yes that's what I'm after, so writing program's for my mac is similar to iPhone app development only with a different UI ect.? and they definitely both use Objective-C? And the current Xcode I got with my leopard install will have everything I need won't it.
    There are definitely some similarities. The lower-level libraries are very similar. At the application level, and the UI architecture level, they are significantly different.
    I just wanted to make a start before I get an intel mac but I didn't want to learn it all then have to start from scratch when I get an intel mac because it is completely different.
    You wouldn't start from "scatch" because it wouldn't be "completely" different. You would be starting near the beginning because it is 70% different.
    If you want to start with the machine you have, focus on writing Mac apps. In a year, maybe you might have something that you could port to Xcode4 and release in the App Store.
    Any machine made since 2007 will run Lion.

  • Help! iPhone programs shut down automatically!

    Have some time had major problems with my iPhone 4S. 'm Not entirely sure, but think it was after I installed iOS 6th
    The problem is that every time I go into any program / ​​app that freezes everything and you come back to the Home screen. It's not just apps but also whether to write sms for example. Everything that was done in the program / ​​app is then deleted. Sometimes you can not even enter the programs / apps and sometimes you can be inside a minute before it freezes. In addition, load it quickly out and the phone seems to work constantly (warmer than usual) even though I do not use it.
    Have tried to find solutions, but nothing seems to work for more than a short period. Have tried:
    - To restore the iPhone to its original settings in iTunes.
    - Making a quick recovery, by holding down both the Home button + mute button for apple shows up.
    - Install a new app.
    - Reinstall apps (erase + install the app again).
    - Restart the phone.
    - Complete all updates available for my apps.
    - Authorized to my iPhone.
    What should I do? I'm really tired of it not working. All tips are welcome!

    HI Sue and Welcome to Apple Discussions...
    I see your are new to Apple Discussions. Please take a moment and click My Settings on the right side of this page and tell us whether you are PC or Mac and which operating system, XP/7 or Mac/ 10. That way your forum profile is setup. Thanks!
    Connect the iPhone to your computer and see if it's recognized in iTunes.
    iPhone - Basic Troubleshooting
    Carolyn

  • Can't set IE Desktop as default program for Assigned Access

    I have searched everywhere for this answer.  Kiosk mode/assigned access is excellent.  But it appears that you can only use IE Modern (Metro) for assigned access and the problem with that is I have found no way to completely lock down IE Modern. 
    I can only partially lock it down but users can still get to the address bar and settings very easily.
    I either need some advice on setting IE to complete lockdown or how to set IE desktop for Assigned  Access.

    Perhaps you can create a special application that will be selected for Assigned Access. This application will then start the desktop variant of Internet Explorer (or an intermediate desktop program). There are some articles about such
    operation based on Launcher class and custom file association.

  • How can i find name of the variable used in the program and assign to a str

    double width= .333;
            int i;
            for (i = 0; i <=2; i ++){
                segment[i] = i+1;
            }is a bit of code...Is there anyway using which I can find out the variable names and assign them to string variables so that i can match them with another table ....
    That is I want the "width", "segment[0]", "segment[1]" and "segment[2]"...
    pls help...

    I am trying to find out the variable names in the program so that they can be matched against a given table for availability. I want to do that so that i can send the name, its type and value as a data packet to another node...I am not familiar with this...pls..would you give me a sample code

  • Checking whether field-symbol from another program is assigned?

    Hi all
    I'm attempting to access a FS from another program.
    As the FS can be assigned, or unassigned within that program, how do I checked for that in my calling program?
    e.g. calling program;
    FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE.
    DATA: lv_var(40) type c.
    lv_var = '(ZTGT_PROG)<read_fs>'.
    ASSIGN (lv_var) TO <fs>.   " statement might dump...

    Hi
    Go through this doc and use accordingly
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Related
    ASSIGN, DATA
    Additional help
    Declaring Field Symbols
    Reward points if useful
    Regards
    Anji

Maybe you are looking for