Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7191091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:39:21+00:00 2026-05-28T19:39:21+00:00

In my cappuccino app, I am reading from an RoR backend via JSON and

  • 0

In my cappuccino app, I am reading from an RoR backend via JSON and putting the results onto a list. When the app first loads everything is fine, but when I edit an item (and write the edit to the database) there is an error generated when the items list is refreshed.

The error is CPRangeException: -[_CPJavaScriptArray objectAtIndex:]: index (-1) beyond bounds (3).

I get this error even if I edit an item without making any actual changes. The JSON string received by the app remains exactly the same in this case, there are no items added or removed and therefore the array should not be written to out of bounds.

Here is my code:

- (void)connection:(CPRURLConnection)connection didReceiveData:(CPString)data
{
    if(connection === listConnection)
    {        
        var results = JSON.parse(data) ;
        var posts = [Post initFromJSONObjects:results];
        [postListView setContent:posts] ;
        // My error occurs at the above line
        [postListView setSelectionIndexes:[[CPIndexSet alloc] initWithIndex:0]] ;
    }
 }

I am not sure if it’s an error with my code or if it’s some kind of inconsistency with the cappuccino framework. Does anybody know what I can do to fix this?

The rest of the code can be found here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:39:22+00:00Added an answer on May 28, 2026 at 7:39 pm

    You should probably simply log what’s in posts before setting it. CPLog.info('posts: ' + posts); should work, or console.log(posts). Next you can set a ‘break on uncaught exception’ debug point in Chrome or Safari to stop at the actual error you are seeing. Make sure you run your app using index-debug.html so that you get full method names. Then it should be an easy matter to look at the calling stack to see where things are going wrong. There’s a lot of information on debugging a Cappuccino app here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Cappuccino app that I am integrating with a Rails backend. A
Problem Cappuccino app initially loads successfully. After an ajax call is made and an
Aside from the language differences Javascript vs. Objective-J what benefits does Cappuccino provide over
I have a rails app with a cappuccino front end that I am trying
I'm integrating a reCAPTCHA into my Cappuccino app and I have it all working
Cappuccino is one. With Cappuccino, you don't need to know HTML. You'll never write
How does the layout support of Cappuccino work? For example the centering and the
I'm trying to get my head around Cappuccino. I'd like my StackOverview peers to
Is there a way to print out a list of Github issues? Other than
I'm creating my first web application and I'm really confused as to what technology

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.