Bug in SeismicXML iPhone SDK sample code

I'm writing an app based on SeismicXML for the XML parsing code, and it turns out there's a bug in the SeismicXML parser. The last item always seems to end up not getting saved to the list. This bug becomes evident when you change:
self.earthquakeLocationLabel.text = newQuake.location;
to
self.earthquakeLocationLabel.text = newQuake.description;
in TableViewCell.m.
I've banged my head into this in my own app only to test out the upstream sample code and find out that it has the same error. There's something about the last item that it parses that causes a problem.
I'm very new to Objective C but this feels like some sort of object initialization/retention/reuse problem...any pointers?

I found two reasons why this is not working. Both found in didStartElement(...)
#1
if (parsedEarthquakesCounter >= MAX_EARTHQUAKES) {
parser abortParsing;
This is premature. If MAX_EARTHQUAKES is set to 5, this condition will be true for any start element within that fifth entry.
#2
The call to addToEarthquakeList()
This is again premature. Since addToEarthquakeList also reloads the displayed table view, the fifth and last entry will never be displayed. The table is reloaded before any data is placed within the Earthquake object for that entry.
Solution
Remove both the if test case and function call above from didStartElement(...)
In didEndElement(...) add the case
else if (elementName isEqualToString:@"entry") {
//insert call to addToEarthquakeList here
//test for MAX_EARTHQUAKES HERE
}

Similar Messages

  • Missing "Crash Landing" iPhone SDK sample code.

    Ok, I'm at the phase in my project where I need to start integrating the audio. I've been told , and theres plenty of references on the net, to try and base off a piece of code off the "Crash Landing" sample code.
    Google tells me it used to be on the Iphone dev page on apples site, but there is no reference to the sample code on Apples site and apples search engine comes up blank.
    Has this been removed? If it has, is there anywhere else that features examples of using the OpenAL architecture. I realise there is a new architecture for audio introduced, but for various reasons, we can't use it.

    Hi i need reference from the crash landing code for my own development...it was there on my machin some months back and i hve also installed on my iphone also using xcode...but i recently discovered the sample code is not there on my machine as mistakenly i have removed it from my machine. i need it so if someone can provide me the sample code i can easily over come the issue in my development as it is been resolve in the crash landing. please if i can get the code it will be of great help.

  • IPhone SDK - Sample code to download a file in a thread

    I am looking for a starting point to implement a download manager. My requirements are simple.
    I want to show a UIProgressView in a view controller and update it as i download file(s) from the internet. The view will have a cancel button, so the view cannot block on downloading the files. The cancel should cancel the download thread in such a way that the thread can cleanup if required.
    To achieve this i guess i will have to download the file(s) in a separate thread and then figure out a way to update the progress bar in the UI thread based on the bytes downloaded from the web.
    Can someone point me to code sample which demonstrates this interaction OR help me with their suggestions?
    Thanks in advnace,
    Shiva

    NSURLRequest is asynchronous by default, so really all you need to do is prepare your NSURLRequests, fire them all off, and then in the delegate you can update the progress bar as each of them returns.
    I'd suggest just having the progress bar update based on how many requests have completed out of the full set, rather than based on the number of bytes downloaded. NSURLResponse doesn't give you byte-by-byte callbacks, so it's quite hard to work out how far along an individual request has progressed.
    Read the URL Loading Scheme document in the API - it's full of example code that you can use.

  • IPhone Kalimba sample code

    Hi all,
    I can't find it from the current Apple iPhone developer page, but there was a
    sample code called Kalimba for iPhone SDK (in Beta 4 release, I think). I played
    with this sample recently, and the sound does not work anymore when I run the
    code in the simulator. I remember it used to work. Was this code deprecated?
    syy

    Kalimba worked in the earlier versions of the SDK. The routine used to create the sound was eliminated during one of the revisions of the SDK. Kalimba was supposed to be rebuilt using the Interface Builder but never was. Apple never re-released it to work with the later SDKs

  • Report Engine SDK sample code questions

    Hello,
    I've been able to view a boxi report in an iframe via the Enterprise SDK by modifying the sample code in the HowToViewWebiReports_VB example.
    I'm not totally happy with the way that's working, so I'm looking at using the Report Engine SDK, although I understand it's performance and scalability isn't quite as good as the Enterprise SDK.
    I'm a VB.NET guy, not a C# guy, and I'm not clear on how the wssdk_net2.0_portal_sample_12.0_en example is supposed to work.
    I don't have one and my CMS server is running Tomcat, not IIS so there's not going to be an ASP.NET web service running there.
    In the dsws.config for the wssdk_net2.0_portal_sample_12.0_en example I put the name of the CMS server, but it's looking for a web service at http://cmsservername:8080/dswsbobje/services/Session, but I get a 404 when i try to hit that. 
    I'm not familiar with Tomcat, but in searching around on the server, I see a dswsbobje directory under the webapps in my Tomcat installation, but I don't see a services or a Session folder underneath that.  In the dswsbobje folder I see the following folders:
    BOAR-INF
    META-INF
    WEB-INF
    xsd
    Is there something else that needs to be installed on the Tomcat server to get the web service running?
    -Eric

    It looks like I have something there.  When I launch launch http://servername:8080/dswsbobje,  I see:
    Apache-AXIS
    Hello! Welcome to Apache-Axis.
    What do you want to do today?
    Validate the local installation's configuration
    see below if this does not work.
    To enable the disabled features, uncomment the appropriate declarations in WEB-INF/web.xml in the webapplication and restart it.
    Validating Axis
    If the "happyaxis" validation page displays an exception instead of a status page, the likely cause is that you have multiple XML parsers in your classpath. Clean up your classpath by eliminating extraneous parsers.
    I clicked on the "Validate" link and I see:
    Axis Happiness Page
    Examining webapp configuration
    QaaWS Configuration
    QaaWS Servlet is not valid.
    ErrorServer servername not found or server may be down
    See Web Application log to get more info or read QaaWS v2 documentation starting with section
    Perhaps this environment needs some additional configuration?

  • Problem in iPhone SDK Sample: [CrashLanding ]

    iPhone SDK build : build 9M2199a
    Sample: CrashLanding
    Version: 1.7
    OpenGL swap buffer method seems to fails sometimes resulting in a crappy blink display. The display seems split into two images. The screen goes messy, I can view the backbuffer blinking over frontbuffer with no drawing update on it.
    Thanks,
    Julien Meyer
    Jadegame.com

    I developed my application based on the CrashLanding sample. I have inherited the same rendering failure. The swap occurs, but it's presenting stale data for one of the frames. The stale data appears to be the first frame rendered. The failure occurs either immediately, or not at all. Restarting the application usually makes the problem go away.
    Has anyone determined a fix for this?
    Thank you,
    Joel-

  • Not able to use Visual studio 2010 editor intelligence while running SDK sample code ?

    whenevr i start sdk sample project in visual studio i can build it ,debug it ,run it but the problem is that VS 2010 editor showing lots of red lines under many lines of code which on Mouse hover show some kind of error(mostly _____ is undefined) moreover i am not able to use intelligence feature of VS editor and i have to check reference of SDK everey time .what is the solution to this problem .

    1. Create environment variable INDESIGN_SDK_DIR with path to root folder of your SDK
    e.x  INDESIGN_SDK_DIR = "C:\SDK\InDesignCS6SDK"
    2. In your project add this to project settings:
    "VSProject"->"Proporties"->"Configuration Proporties"->"VC++ Directories"->"Executable Directories" add:
    $(INDESIGN_SDK_DIR)\devtools\bin
    "VSProject"->"Proporties"->"Configuration Proporties"->"C++"->"General"->"Additional Include Directories" add:
    $(INDESIGN_SDK_DIR)\source\precomp\msvc;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\xmedia;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\preflight;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\ui;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\tables;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\text;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\graphics;
    $(INDESIGN_SDK_DIR)\source\public\libs\widgetbin\includes;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\workgroup;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\interactive;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\interactive\ui;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\colormgmt;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\utils;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\incopy;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\layout;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\architecture;
    $(INDESIGN_SDK_DIR)\source\public\interfaces\cjk;
    $(INDESIGN_SDK_DIR)\source\precomp\common;
    $(INDESIGN_SDK_DIR)\source\public\includes;
    $(INDESIGN_SDK_DIR)\source\public\libs\publiclib\plugins;
    $(INDESIGN_SDK_DIR)\source\public\libs\publiclib\files;
    $(INDESIGN_SDK_DIR)\source\public\libs\publiclib\objectmodel;
    $(INDESIGN_SDK_DIR)\external\asl\boost_libraries;
    $(INDESIGN_SDK_DIR)\source\sdksamples\common;
    $(INDESIGN_SDK_DIR)\external\afl\includes
    "VSProject"->"Proporties"->"Configuration Proporties"->"Linker"->"General"->"Additional Library Directories" add:
    $(INDESIGN_SDK_DIR)\build\win\objr;
    $(INDESIGN_SDK_DIR)\external\afl\libs\win\release;
    $(INDESIGN_SDK_DIR)\external\icu\libs\win\release
    "VSProject"->"Proporties"->"Configuration Proporties"->"Linker"->"Input"->"Additional Dependencies" add:
    PMRuntime.lib;
    Public.lib;
    WidgetBin.lib;
    AFL.lib;

  • SDK sample code for Changing name of Exported file thru Webi schedule

    Hi experts,
    I am wanting to know if someone has got any sample Java SDK code which I can use to login to FTP and rename the pdf files generated from webi schedule script and append customised date format towards the end.

    Hi Prabhat,
    For online samples
    https://www.sdn.sap.com/irj/boc/samples
    For detalied descripation on BO SDK.
    https://www.sdn.sap.com/irj/boc/sdklibrary
    For BOE SDK guide.
    http://help.sap.com/businessobject/product_guides/boexir31/en/boesdk_java_dg_12_en.zip
    This would give you complete information on scheduling.
    For RE SDK guide.
    http://help.sap.com/businessobject/product_guides/boexir31/en/resdk_java_dg_12_en.zip
    This would give you information on how deal with Desktop intelligence report and Web intelligence report.

  • SDK Sample Code

    Hi,
    I have tested a form from B1DE as given in elearning.
    I have used VB.net and repeated all steps with this tool
    and I can Find,Add, update data in my form without any problem
    Now my question are
    1) In VB.Net there are no components i.e. UI Interface
    2) How can I add ChooseFromList to a specific field
    Please Help
    Best Regards,
    Umer Nasim Mirza

    Hi Umer,
    This is the way to add a CFL :
    1. Define your CFLs :
    Here i create a CFL with conditions :
    private void AddChooseFromList(SAPbouiCOM.Form myForm)
                try
                    SAPbouiCOM.ChooseFromListCollection oCFLs;
                    SAPbouiCOM.Conditions oCons;
                    SAPbouiCOM.Condition oCon;
                    oCFLs = myForm.ChooseFromLists;
                    SAPbouiCOM.ChooseFromList oCFL;
                    SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams;
                    oCFLCreationParams = (SAPbouiCOM.ChooseFromListCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams);
                    oCFLCreationParams.MultiSelection = false;
                    oCFLCreationParams.ObjectType = "2";
                    oCFLCreationParams.UniqueID = "IFC_CFL";
                    oCFL = oCFLs.Add(oCFLCreationParams);
                    oCons = oCFL.GetConditions();
                    oCon = oCons.Add();
                    oCon.BracketOpenNum = 2;
                    oCon.Alias = "CardType";
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    oCon.CondVal = "S";
                    oCon.BracketCloseNum = 1;
                    oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;
                    oCon = oCons.Add();
                    oCon.BracketOpenNum = 1;
                    oCon.Alias = "GroupCode";
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    oCon.CondVal = return_GroupNum("Auteur");
                    oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;
                    oCon = oCons.Add();
                    oCon.Alias = "GroupCode";
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    oCon.CondVal = return_GroupNum("Editeur");
                    oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;
                    oCon = oCons.Add();
                    oCon.Alias = "GroupCode";
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;
                    oCon.CondVal = return_GroupNum("Traducteur");
                    oCon.BracketCloseNum = 2;
                    oCFL.SetConditions(oCons);             
                catch (Exception ex)
    //Catch Error
    2. Affect your CFL to a specific field :
    oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("3").Specific;
                    oEdit.ChooseFromListUID = "IFC_CFL";
                    oEdit.ChooseFromListAlias = "CardCode";
    Hope it's help you
    Regards
    Michael

  • Issues in Deploying the Sample code

    Hi,
    I downloaded  BusinessObjects Enterprise Java SDK Sample Code from SDK Developer Library.  I unzipped the content to a folder(Sample) in tomcat/webapps.  Now when I launched the application using the following url http://localhost:8080/Sample/start.jsp
    I am getting the following error.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.exception.SDKException resolves to a package
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.framework.CrystalEnterprise resolves to a package
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.framework.IEnterpriseSession resolves to a package
    Generated servlet error:
    Only a type can be imported. com.crystaldecisions.sdk.framework.ISessionMgr resolves to a package
    An error occurred at line: 36 in the jsp file: /start.jsp
    Generated servlet error:
    ISessionMgr cannot be resolved to a type
    An error occurred at line: 36 in the jsp file: /start.jsp
    Generated servlet error:
    CrystalEnterprise cannot be resolved
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Please let me know whether I have to do any configuration to make this application running.
    Thanks and Regards,
    Subbu S

    You can find the neccessary jar files here:
    C:Program FilesBusiness ObjectsCommon4.0javalib
    Check the developer guide for guidance on exactly which jars are required:
    https://www.sdn.sap.com/irj/boc/sdklibrary
    BusinessObjects Enterprise Java SDK > Developer Guide > Setting up the development environment > Web application setup > JAR files needed for deployment of Business Objects Software

  • IPhone SDK: auto-rotation sets wrong bounds in view?

    Hi all,
    Can anybody confirm if this is a bug in the iPhone SDK? I have a ViewController that defines as its view a DimensionsLogger, which is a trivial subclass of UIView that just logs its frame, bounds and center properties when layoutSubviews is invoked.
    When I set this view as the root view in my application, the dimensions are logged like so (portrait mode):
    Bounds: (0.000000, 0.000000) x (320.000000, 460.000000)
    I rotate it to landscape mode and the bounds are logged:
    Bounds: (0.000000, 0.000000) x (390.000000, 390.000000)
    Bounds: (0.000000, 0.000000) x (480.000000, 300.000000)
    Then back to portrait mode:
    Bounds: (0.000000, 0.000000) x (390.000000, 390.000000)
    Bounds: (0.000000, 0.000000) x (320.000000, 460.000000)
    So far, so good.
    When I add my DimensionLogger + ViewController to a NavigationController, however, the same process (repeated several times) yields the following output:
    Bounds: (0.000000, 0.000000) x (320.000000, 416.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 358.000000)
    Bounds: (0.000000, 0.000000) x (390.000000, 346.000000)
    The bounds value never returns to the original dimensions.
    Am I missing something, or is this a bug? The practical consequence of this is that it seems impossible to combine the following 3 UI elements:
    - "anchoring" something to the bottom of a view, like a UIToolbar (NOT a tabbar)
    - Nesting that view in a UINavigationController
    - Supporting portrait and landscape interface orientation.
    Also, if I file this as a bug, is there any way to search the bug report tool to see if this has already been filed? I've logged into the tool and I see some search functionality but it only seems to search bugs I've previously filed.
    Thanks,
    Russ

    Just wanted to add that I've tried this in the simulator and on a provisioned iPod touch, same results on both.
    Russ

  • Apple's Policy on Sample Code for iPhone

    I'm a student and decided to bang out my Computer Graphics course using the iPhone. That means taking all the stuff in class we learn about OpenGL and GLUT and then tossing 50% of it out the window for OpenGL ES. This is not for me to complain, though. I'm having a blast and will be applying to the WWDC student scholarship program to (fingers crossed) get better knowledge.
    You can see the fruits of my weekend onmy website:
    http://clocksarestupid.net/articles/2008/04/02/iphone-sdk-zelda-demo
    I want to release the source, but I don't know if that will get me in trouble because I'm using some of Apple's sample wrapper classes to make textures and sounds easier to manage (most of the code is drawing different shapes with polygons/triangles/lines). Anyone know the official policy, or know where the best place to start digging is?
    Thanks!
    PS - If anyone has questions about using OpenGL ES, feel free to forward them to me. I'll do my best to answer them!

    As far as I know Apple's sample source (along with anything you write using the official SDK) is still covered under NDA and can't be made public. Whether or not Apple will actually do something about it if you make it public is questionable, but you do so at your own risk. (My guess is that the worst that will happen is their legal department will send you a cease and desist letter, at which point you simply yank the code from your site but I'm not a lawyer.)

  • How to run the sample code using the sdk?

    Hi,
    I want to run the jsp code from the enterprize sdk available in the sdn community. Can any one tell me how to execute these jsp sample codes and what is the pre-requisite regarding the set up.
    I already have the deployment ready.
    thanks
    AMar

    Hi Amar,
    To execute samples code, it is same what is required for normal J2EE application.
    Make sure add all the jars to your web application.
    These jars can be found on your BO server installation if windows.
    For BOE XI 3.x
    C:\Program Files\Business Objects\common\4.0\java\lib
    C:\Program Files\Business Objects\common\4.0\java\lib\external
    For BOE XI R2
    C:\Program Files\Business Objects\common\3.5\java\lib
    C:\Program Files\Business Objects\common\3.5\java\lib\external
    Thanks,
    Praveen.

  • Need Of SDK and Sample codes

    I'm in need of SDK and sample codes to connect my HP Deskjet 3525 Printer from my own application (Android). Any help from your side???
    This question was solved.
    View Solution.

    Hi Yokesh,
    I would suggest you post your question on Android Forums. HP supports printing from Cloud Print,  Eprint and a few others but we would not have any support options for an app you have created. Maybe you could contact the platform company for assistance. For example if you were using Apps maker store you could contact them.
    Best of luck.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • Bug in sample code of Exchange Activ Sync cause birthday shift

    Dear Apple Development Team,
    Continuing the archived discussion 'Exchange Birthday Shifted by 1 day' I just want to inform you that Microsoft identified the reason for shifted birthdays using Exchange Active Sync. According to Microsoft the mentioned problem is not caused by a server-related problem, but due to an error in a Microsoft sample code which was used in Windows Mobile 6.5, Windows Phone 7, Hotmail Outlook Connector and even in iOS. That means that the client side connection was developed incorrectly. Microsoft and Apple copied the incorrect code from time to time using the mentioned Exchange code in their software (iOS, etc).
    However, Microsoft already fixed the birthday bug within the latest update of the Outlook Hotmail Connector (please check changelog) as well as in the current update of Windows Phone 7.5 (Mango). For more information please check the following sites:
    German: http://answers.microsoft.com/de-de/winphone/forum/wp7-sync/geburtstags-bug/15075 df5-27f3-4518-8e27-b228d4eaab06?page=1
    English: http://answers.microsoft.com/en-us/winphone/forum/wp7-sync/birthdays-are-always- set-one-day-earlier-when/b3d16871-ca24-4a26-a0fc-5b0437904a22
    Due to the fact, that the mentioned problem isn't fixed in iOS until now, I would be glad if Apple could fix it as soon as possible, too. This bug is really annoying.
    Best regards,
    Hannes

    Hi,
    as far as I know the bug is fixed in Hotmail Outlook Connector now. But in the Windows Phone Mango release the bug is still active in "some" cases (for birthdays in the winter time everything is fine and for birthdays in summer time the bug is still there - or vice versa ).
    Does Apple plan to fix that bug somehow? As the bug can be fixed with a new release of Outlook connector and partly fixed in the new Windows Phone release it should be a failure in the code of the mobile devices and not with the Hotmail servers - so Apple developers have to work on that.
    Does anybody know when this annoying bug will be fixed?
    Cheers,
    Marcel

Maybe you are looking for

  • Windows Update fails on Server 2012 R2 Virtual Machine

    I have set up a virtual network with two virtual machines. The first VM is Server 2008 R2 and is set up as a domain controller. The second VM is Server 2012 R2, and has been joined to the domain.  The DC (TestVM1) is also set up as a DNS server.  Fro

  • DFSR Reporting " not working correctly

    I'm trying to get the following script to work, posted questions at the site but not sure if he is viewing the blog anymore. http://gallery.technet.microsoft.com/scriptcenter/10ca8b47-b0ec-4910-bdd7-52ce2d4bca41#conten Couple of things is not working

  • [apvlv] mouse scrolling doesn't work anymore

    Hello guys, it occured with some newer version of apvlv that mouse scrolling isn't working anymore. Is there any chance to activate that feature again? Best regards

  • Any idoc for FBRA Transaction( both reset and reverse)?

    Hi all, Is there any idoc to accomplish functionality of FBRA tcode( both reset and reverse). Please advise. Subba

  • Getting erroe when Sending mail through Javamail

    I am a new Java Programmer I am getting the followoing error message javax.mail.sendFailedException: sending failed; javax.mail.MessagingException: Could not connect SMTP host: aol.com, port: 25; nested exception is: java.net.SocketException: connect