Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Xcode won't stop indexing

I am creating an app in Swift based off of the Algorhythm app for practice. All I have done is created my first Struct with an array that contains 21 dictionaries each with 4 key value pairs. Upon completing the Struct and its array Xcode stuck indexing and processing files. Any advice, this is the second time I have created it.

import Foundation

struct BenchmarkWodLibrary {

    let benchmarkLibrary = [

        [
            "name": "Amanda",
            "whatFor": "For Time",
            "description": "9,7 and 5 rep rounds of:\nMuscle-ups\nSnatches (135/95 lbs.)",
            "instructions": ""
        ],
        [
            "name": "Angie",
            "whatFor": "For Time",
            "description": "100 Pull-ups\n100 Push-ups\n100 Sit-ups\n100 Squats",
            "instructions": "Complete all reps of each exercise before moving to the next."
        ],
        [
            "name": "Annie",
            "whatFor": "For Time",
            "description": "50-40-30-20 and 10 rep rounds of:\nDouble-unders\nSit-ups",
            "instructions": ""
        ],
        [
            "name": "Barbara",
            "whatFor": "5 rounds",
            "description": "20 Pull-ups\n30 Push-ups\n40 Sit-ups\n50 Squats",
            "instructions": "Time each round.\nRest precisely three minutes between each round."
        ],
        [
            "name": "Chelsea",
            "whatFor": "EMOM for 30 min",
            "description": "5 Pull-ups\n10 Push-ups\n15 Squats",
            "instructions": ""
        ],
        [
            "name": "Cindy",
            "whatFor": "AMRAP for 20 min",
            "description": "5 Pull-ups\n10 Push-ups\n15 Squats",
            "instructions": ""
        ],
        [
            "name": "Diane",
            "whatFor": "For Time",
            "description": "21-15-9 rep rounds of:\nDeadlift 225/155 lbs\nHandstand push-ups",
            "instructions": ""
        ],
        [
            "name": "Elizabeth",
            "whatFor": "For Time",
            "description": "21-15-9 rep rounds of:\nClean 135/95 lbs\nRing Dips",
            "instructions": ""
        ],
        [
            "name": "Eva",
            "whatFor": "5 Rounds For Time",
            "description": "Run 800 meters\n2 pood KB swing, 30 reps\n30 pullups",
            "instructions": ""
        ],
        [
            "name": "Fran",
            "whatFor": "5 Rounds For Time",
            "description": "21-15-9 rep rounds of:\nThruster 95/65lbs\nPull-ups",
            "instructions": ""
        ],
        [
            "name": "Grace",
            "whatFor": "30 Reps For Time",
            "description": "Clean and Jerk 135/95 lbs",
            "instructions": ""
        ],
        [
            "name": "Helen",
            "whatFor": "3 Rounds For Time",
            "description": "400 meter run\n1.5/1 pood kettlebell swing x 21\nPull-ups 12 reps",
            "instructions": ""
        ],
        [
            "name": "Isabel",
            "whatFor": "30 Reps For Time",
            "description": "Snatch 135/95 lbs",
            "instructions": ""
        ],
        [
            "name": "Jackie",
            "whatFor": "For Time",
            "description": "1000 meter row\nThruster 45lbs (50 reps)\nPull-ups (30 reps)",
            "instructions": ""
        ],
        [
            "name": "Karen",
            "whatFor": "For Time",
            "description": "Wall-ball 150 shots",
            "instructions": ""
        ],
        [
            "name": "Kelly",
            "whatFor": "5 Rounds For Time",
            "description": "Run 400 meters\n30 box jump, 24 inch box\n30 Wall ball shots, 20lb ball",
            "instructions": ""
        ],
        [
            "name": "Linda",
            "whatFor": "For Time",
            "description": "10/9/8/7/6/5/4/3/2/1 rep rounds of\nDeadlift 1 1/2 BW\nBench BW\nClean 3/4 BW",
            "instructions": ""
        ],
        [
            "name": "Lynne",
            "whatFor": "5 Rounds For Max Reps",
            "description": "Bench press BW\nPull-ups",
            "instructions": "There is NO time component to this WOD, although some versions Rx the movements as a couplet."
        ],
        [
            "name": "Mary",
            "whatFor": "AMRAP 20 min",
            "description": "5 Handstand push-ups\n10 1-legged squats\n15 Pull-ups",
            "instructions": ""
        ],
        [
            "name": "Nancy",
            "whatFor": "5 Rounds For Time",
            "description": "400 meter run\nOverhead squat 95/65lbs x 15 reps",
            "instructions": ""
        ],
        [
            "name": "Nicole",
            "whatFor": "20 min AMRAP",
            "description": "Run 400 meters\nMax rep pull-ups",
            "instructions": "Note number of pull-ups completed for each round."
        ]

    ]

}

Hey William, I thought I might let you know I reformatted your code, it makes it easier to read. Here is how you do it:

  • ```name of the language in lower case
  • code
  • ```

5 Answers

I figured it out

let benchmarkLibrary: [[String:AnyObject]] = [

I don't quite understand why it worked but so far so good.

Hey William. Sorry, but I'm not sure what could be going wrong. Are you running lots of programs on a slow computer (like what I do)?

Thats the weird thing its a 2014 MacBook Pro with nothing else running. Just wondering if there is a different way to do it to stop this.

You might want to try re-booting the computer

Glad you got it! Happy coding!