Will heat set off a smoke detector placed in an attic?
Heat will not set off a smoke detector. Heat will set off a heat detector, but most heat detectors would not be set off by the temperatures in an attic (and if one is, if probably means the attic could stand some ventilation upgrades.) A heat detector is commonly employed in areas where some minor smoke might be expected but fire is still a concern (such as near the stove in a kitchen, or directly over an oil furnace or boiler, which can smoke a bit when being serviced - much more so than a gas furnace or boiler.)

A photo-electric smoke detector can be set off by dust (and if poorly designed, by spiders getting in the beam - a better designed one will exclude spiders from that area, but I have certainly seen false alarms that were blamed on spiders in the unit.) However, if nothing is stirring up dust, that is relatively unlikely.